minix/external/gpl3/binutils/patches/0001-minix.patch

238 lines
9.4 KiB
Diff
Raw Normal View History

diff -rNU3 dist.nbsd/bfd/config.bfd dist/bfd/config.bfd
--- dist.nbsd/bfd/config.bfd 2013-04-08 23:50:35.000000000 +0200
+++ dist/bfd/config.bfd 2013-04-09 00:31:05.000000000 +0200
@@ -281,7 +281,7 @@
;;
arm-*-elf | arm-*-freebsd* | arm*-*-linux-* | arm*-*-conix* | \
arm*-*-uclinux* | arm-*-kfreebsd*-gnu | \
- arm*-*-eabi* )
+ arm*-*-eabi* | arm*-*-minix*)
targ_defvec=bfd_elf32_littlearm_vec
targ_selvecs=bfd_elf32_bigarm_vec
;;
@@ -663,6 +663,9 @@
i[3-7]86-none-*)
targ_defvec=i386coff_vec
;;
+ i[3-7]86-*-minix)
+ targ_defvec=bfd_elf32_i386_minix_vec
+ ;;
i[3-7]86-*-aout* | i[3-7]86*-*-vsta*)
targ_defvec=i386aout_vec
;;
diff -rNU3 dist.nbsd/bfd/configure dist/bfd/configure
--- dist.nbsd/bfd/configure 2013-04-08 23:52:18.000000000 +0200
+++ dist/bfd/configure 2013-04-09 00:31:05.000000000 +0200
@@ -15210,6 +15210,7 @@
bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;;
bfd_elf32_i386_sol2_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ bfd_elf32_i386_minix_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_i386_dragonfly_vec) tb="$tb elf32-i386.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_i386_nacl_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_i386_vxworks_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
diff -rNU3 dist.nbsd/bfd/configure.in dist/bfd/configure.in
--- dist.nbsd/bfd/configure.in 2013-04-08 23:50:41.000000000 +0200
+++ dist/bfd/configure.in 2013-04-09 00:31:05.000000000 +0200
@@ -709,6 +709,7 @@
bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;;
bfd_elf32_i386_sol2_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ bfd_elf32_i386_minix_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_i386_nacl_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_i386_vxworks_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-vxworks.lo elf32.lo $elf" ;;
diff -rNU3 dist.nbsd/bfd/elf32-i386.c dist/bfd/elf32-i386.c
--- dist.nbsd/bfd/elf32-i386.c 2013-04-09 00:27:33.000000000 +0200
+++ dist/bfd/elf32-i386.c 2013-04-09 00:31:05.000000000 +0200
@@ -4962,6 +4962,18 @@
#include "elf32-target.h"
+/* MINIX3 support. */
+
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM bfd_elf32_i386_minix_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf32-i386-minix"
+
+#undef elf32_bed
+#define elf32_bed elf32_i386_minix_bed
+
+#include "elf32-target.h"
+
/* FreeBSD support. */
#undef TARGET_LITTLE_SYM
diff -rNU3 dist.nbsd/bfd/targets.c dist/bfd/targets.c
--- dist.nbsd/bfd/targets.c 2013-04-08 23:50:47.000000000 +0200
+++ dist/bfd/targets.c 2013-04-09 00:31:05.000000000 +0200
@@ -617,6 +617,7 @@
extern const bfd_target bfd_elf32_hppa_vec;
extern const bfd_target bfd_elf32_i370_vec;
extern const bfd_target bfd_elf32_i386_freebsd_vec;
+extern const bfd_target bfd_elf32_i386_minix_vec;
extern const bfd_target bfd_elf32_i386_nacl_vec;
extern const bfd_target bfd_elf32_i386_sol2_vec;
extern const bfd_target bfd_elf32_i386_vxworks_vec;
diff -rNU3 dist.nbsd/config.guess dist/config.guess
--- dist.nbsd/config.guess 2013-04-08 23:50:48.000000000 +0200
+++ dist/config.guess 2013-04-09 00:31:05.000000000 +0200
@@ -858,8 +858,8 @@
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
+ *:Minix:*:*)
+ echo ${UNAME_MACHINE}-elf32-minix
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
diff -rNU3 dist.nbsd/gas/config/tc-i386.h dist/gas/config/tc-i386.h
--- dist.nbsd/gas/config/tc-i386.h 2013-04-08 23:50:49.000000000 +0200
+++ dist/gas/config/tc-i386.h 2013-04-09 00:31:05.000000000 +0200
@@ -68,6 +68,10 @@
#define ELF_TARGET_FORMAT64 "elf64-x86-64-sol2"
#endif
+#ifdef TE_MINIX
+#define ELF_TARGET_FORMAT "elf32-i386-minix"
+#endif
+
#ifndef ELF_TARGET_FORMAT
#define ELF_TARGET_FORMAT "elf32-i386"
#endif
diff -rNU3 dist.nbsd/gas/config/te-minix.h dist/gas/config/te-minix.h
--- dist.nbsd/gas/config/te-minix.h 1970-01-01 01:00:00.000000000 +0100
+++ dist/gas/config/te-minix.h 2013-04-09 00:31:05.000000000 +0200
@@ -0,0 +1,9 @@
+#define TE_MINIX 1
+
+/* Added these, because if we don't know what we're targeting we may
+ need an assembler version of libgcc, and that will use local
+ labels. */
+#define LOCAL_LABELS_DOLLAR 1
+#define LOCAL_LABELS_FB 1
+
+#include "obj-format.h"
diff -rNU3 dist.nbsd/gas/configure dist/gas/configure
--- dist.nbsd/gas/configure 2013-04-08 23:50:57.000000000 +0200
+++ dist/gas/configure 2013-04-09 00:31:05.000000000 +0200
@@ -6127,6 +6127,10 @@
fi
;;
+minix*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
gnu*)
lt_cv_deplibs_check_method=pass_all
;;
diff -rNU3 dist.nbsd/gas/configure.tgt dist/gas/configure.tgt
--- dist.nbsd/gas/configure.tgt 2013-04-08 23:50:58.000000000 +0200
+++ dist/gas/configure.tgt 2013-04-09 00:31:05.000000000 +0200
@@ -426,6 +426,8 @@
*-*-elf | *-*-sysv4*) fmt=elf ;;
*-*-solaris*) fmt=elf em=solaris ;;
*-*-aros*) fmt=elf em=linux ;;
+ i*-*-minix*) fmt=elf em=minix ;;
+ arm*-*-minix*) fmt=elf em=armeabi ;;
*-*-vxworks* | *-*-windiss) fmt=elf em=vxworks ;;
*-*-netware) fmt=elf em=netware ;;
esac
diff -rNU3 dist.nbsd/ld/Makefile.in dist/ld/Makefile.in
--- dist.nbsd/ld/Makefile.in 2013-04-08 23:50:59.000000000 +0200
+++ dist/ld/Makefile.in 2013-04-09 00:31:05.000000000 +0200
@@ -449,6 +449,7 @@
earmelf_fbsd.c \
earmelf_linux.c \
earmelf_linux_eabi.c \
+ earmelf_minix.c \
earmelf_nbsd.c \
earmelf_vxworks.c \
earmelfb.c \
@@ -566,6 +567,7 @@
eelf_i386_chaos.c \
eelf_i386_fbsd.c \
eelf_i386_ldso.c \
+ eelf_i386_minix.c \
eelf_i386_sol2.c \
eelf_i386_vxworks.c \
eelf_s390.c \
@@ -2156,6 +2158,10 @@
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf_linux_eabi "$(tdir_armelf_linux_abi)"
+earmelf_minix.c: $(srcdir)/emulparams/armelf_minix.sh \
+ $(srcdir)/emulparams/armelf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armelf_minix "$(tdir_armelf_minix)"
earmelf_nbsd.c: $(srcdir)/emulparams/armelf_nbsd.sh \
$(srcdir)/emulparams/armelf.sh \
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
@@ -2640,6 +2646,10 @@
eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)"
+eelf_i386_minix.c: $(srcdir)/emulparams/elf_i386_minix.sh \
+ $(srcdir)/emulparams/elf_i386.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_i386_minix "$(tdir_elf_i386_minix)"
eelf_i386_sol2.c: $(srcdir)/emulparams/elf_i386_sol2.sh \
$(srcdir)/emulparams/solaris2.sh \
$(srcdir)/emultempl/solaris2.em \
diff -rNU3 dist.nbsd/ld/configure.tgt dist/ld/configure.tgt
--- dist.nbsd/ld/configure.tgt 2013-04-08 23:51:00.000000000 +0200
+++ dist/ld/configure.tgt 2013-04-09 00:31:05.000000000 +0200
@@ -68,6 +68,8 @@
armeb-*-elf) targ_emul=armelfb ;;
arm-*-elf | arm*-*-eabi*)
targ_emul=armelf ;;
+arm*-*-minix*) targ_emul=armelf_minix
+ targ_extra_emuls="armelf" ;;
arm*-*-symbianelf*) targ_emul=armsymbian;;
arm-*-kaos*) targ_emul=armelf ;;
arm9e-*-elf) targ_emul=armelf ;;
@@ -180,6 +182,8 @@
i[3-7]86-*-bsd386) targ_emul=i386bsd ;;
i[3-7]86-*-bsdi*) targ_emul=i386bsd ;;
i[3-7]86-*-aout) targ_emul=i386aout ;;
+i[3-7]86-*-minix) targ_emul=elf_i386_minix
+ targ_extra_emuls="elf_i386" ;;
i[3-7]86-*-linux*aout*) targ_emul=i386linux
targ_extra_emuls=elf_i386
tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'` ;;
diff -rNU3 dist.nbsd/ld/emulparams/armelf_minix.sh dist/ld/emulparams/armelf_minix.sh
--- dist.nbsd/ld/emulparams/armelf_minix.sh 1970-01-01 01:00:00.000000000 +0100
+++ dist/ld/emulparams/armelf_minix.sh 2013-04-09 00:31:05.000000000 +0200
@@ -0,0 +1,15 @@
+. ${srcdir}/emulparams/armelf.sh
+. ${srcdir}/emulparams/elf_minix.sh
+OUTPUT_FORMAT="elf32-littlearm"
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
+
+DATA_START_SYMBOLS='PROVIDE (__data_start = .);';
+
+# Dynamic libraries support
+GENERATE_SHLIB_SCRIPT=yes
+TARGET2_TYPE=got-rel
+
+GENERATE_PIE_SCRIPT=yes
+
+unset EMBEDDED
diff -rNU3 dist.nbsd/ld/emulparams/elf_i386_minix.sh dist/ld/emulparams/elf_i386_minix.sh
--- dist.nbsd/ld/emulparams/elf_i386_minix.sh 1970-01-01 01:00:00.000000000 +0100
+++ dist/ld/emulparams/elf_i386_minix.sh 2013-04-09 00:31:05.000000000 +0200
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/elf_i386.sh
+. ${srcdir}/emulparams/elf_minix.sh
+OUTPUT_FORMAT="elf32-i386-minix"
diff -rNU3 dist.nbsd/ld/emulparams/elf_minix.sh dist/ld/emulparams/elf_minix.sh
--- dist.nbsd/ld/emulparams/elf_minix.sh 1970-01-01 01:00:00.000000000 +0100
+++ dist/ld/emulparams/elf_minix.sh 2013-04-09 00:31:05.000000000 +0200
@@ -0,0 +1 @@
+ELF_INTERPRETER_NAME=\"/libexec/ld-elf.so.1\"