summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/ld
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2004-06-16 06:55:49 +0000
committerobrien <obrien@FreeBSD.org>2004-06-16 06:55:49 +0000
commit0aa70a0bbc3355e0c99649e3cf2cc53832f17a07 (patch)
tree9094635996e728bb16e2196f5b17dad69cc9fdd6 /contrib/binutils/ld
parent5bae048b018da422851dfc32d4700d7c8cbeedf4 (diff)
downloadFreeBSD-src-0aa70a0bbc3355e0c99649e3cf2cc53832f17a07.zip
FreeBSD-src-0aa70a0bbc3355e0c99649e3cf2cc53832f17a07.tar.gz
Update HEAD with the stock binutils_2_15_20040523 file.
Diffstat (limited to 'contrib/binutils/ld')
-rw-r--r--contrib/binutils/ld/configure.host91
-rw-r--r--contrib/binutils/ld/configure.tgt261
-rw-r--r--contrib/binutils/ld/emulparams/elf64alpha.sh53
-rw-r--r--contrib/binutils/ld/ld.1367
4 files changed, 521 insertions, 251 deletions
diff --git a/contrib/binutils/ld/configure.host b/contrib/binutils/ld/configure.host
index 436a912..f2e1eb4 100644
--- a/contrib/binutils/ld/configure.host
+++ b/contrib/binutils/ld/configure.host
@@ -7,12 +7,10 @@
# HDEFINES host specific compiler flags
# HOSTING_CRT0 crt0.o file used for bootstrapping
# HOSTING_LIBS libraries used for bootstrapping
-# NATIVE_LIB_DIRS library directories to search on this host
HDEFINES=
HOSTING_CRT0=/lib/crt0.o
-HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libgcc=\`${CC} -print-libgcc-file-name\`; fi; if [ -f ../gcc/libgcc_eh.a ]; then libgcc="$libgcc ../gcc/libgcc_eh.a"; else libgcc_eh=\`${CC} -print-file-name=libgcc_eh.a\`; if [ x"$libgcc_eh" != xlibgcc_eh.a ]; then libgcc="$libgcc $libgcc_eh"; fi; fi; echo $libgcc -lc $libgcc`'
-NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib'
+HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libgcc=\`${CC} -print-libgcc-file-name\`; fi; if [ -f ../gcc/libgcc_eh.a ]; then libgcc="$libgcc ../gcc/libgcc_eh.a"; else libgcc_eh=\`${CC} -print-file-name=libgcc_eh.a\`; if [ x"$libgcc_eh" != xlibgcc_eh.a ]; then libgcc="$libgcc $libgcc_eh"; fi; fi; echo --start-group $libgcc -lc --end-group`'
#
# Generic configurations:
@@ -20,13 +18,8 @@ NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib'
case "${host}" in
-*-*-freebsd*)
- NATIVE_LIB_DIRS='/lib /usr/lib /usr/local/lib'
- # Older versions of gcc do not use a specs file. In those cases,
- # gcc -print-file-name=specs will simply print specs. We create a
- # dummy specs files to handle this.
- echo "-dynamic-linker `${CC} --print-prog-name=ld-elf.so.1`" > specs
- HOSTING_CRT0='-dynamic-linker `${CC} --print-file-name=ld-elf.so.1` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`'
+*-*-freebsd* | *-*-kfreebsd*-gnu)
+ HOSTING_CRT0='-dynamic-linker `[ -f \`${CC} --print-prog-name=ld-elf.so.1\` ] || echo /usr/libexec/``${CC} --print-prog-name=ld-elf.so.1` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`'
HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
;;
@@ -44,6 +37,36 @@ case "${host}" in
HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
;;
+*-*-netbsd*)
+ # Different versions of NetBSD with the ELF object format use different
+ # sets of start/end files.
+ HOSTING_CRT0='-dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o'
+ if [ -f `${CC} --print-file-name=crti.o` ]; then
+ # Support for GCC's crtstuff present.
+ HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crti.o`"
+ if [ -f ../gcc/crtbegin.o ]; then
+ HOSTING_CRT0="$HOSTING_CRT0 ../gcc/crtbegin.o"
+ else
+ HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crtbegin.o`"
+ fi
+ else
+ # Support for GCC's crtstuff not present.
+ HOSTING_CRT0="$HOSTING_CRT0 `${CC} --print-file-name=crtbegin.o`"
+ fi
+ if [ -f `${CC} --print-file-name=crtn.o` ]; then
+ # Support for GCC's crtstuff present.
+ if [ -f ../gcc/crtbegin.o ]; then
+ HOSTING_LIBS="$HOSTING_LIBS ../gcc/crtend.o"
+ else
+ HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtend.o`"
+ fi
+ HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtn.o`"
+ else
+ # Support for GCC's crtstuff not present.
+ HOSTING_LIBS="$HOSTING_LIBS `${CC} --print-file-name=crtend.o`"
+ fi
+ ;;
+
esac
#
@@ -56,48 +79,45 @@ case "${host}" in
# No further tweaking needed
;;
-alpha*-*-netbsd*)
- HOSTING_CRT0=/usr/lib/crt0.o
+am33_2.0-*-linux*)
+ HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"`
;;
arm*-*-linux-gnu*)
- HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux,g"`
+ HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"`
;;
hppa*64*-*-hpux11*)
- NATIVE_LIB_DIRS=/usr/lib/pa20_64
HOSTING_CRT0=/usr/ccs/lib/pa20_64/crt0.o
# Even if CC is not gcc, the tests use gcc.
- HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else if test "$GCC" = yes; then ${CC} --print-libgcc-file-name; else gcc --print-libgcc-file-name; fi fi` -lc /usr/lib/pa20_64/milli.a'
+ HOSTING_LIBS='--start-group `if [ -f ../gcc/libgcc.a ]; then echo ../gcc/libgcc.a; else if test "$GCC" = yes; then ${CC} --print-libgcc-file-name; else gcc --print-libgcc-file-name; fi fi` -lc --end-group /usr/lib/pa20_64/milli.a'
;;
-i[3456]86-*-bsd* | i[34567]86-*-freebsd[12] | i[34567]86-*-freebsd[12]\.* | i[34567]86-*-freebsd*aout* | i[3456]86-*-netbsd*)
+i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[12] | i[3-7]86-*-freebsd[12]\.* | i[3-7]86-*-freebsd*aout*)
HOSTING_CRT0=/usr/lib/crt0.o
;;
-i[3456]86-*-sysv4*)
+i[3-7]86-*-sysv4*)
HOSTING_CRT0='/usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` /usr/ccs/lib/crtn.o'
- NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
;;
-i[3456]86-sequent-ptx* | i[3456]86-sequent-sysv*)
+i[3-7]86-sequent-ptx* | i[3-7]86-sequent-sysv*)
HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`'
;;
-i[3456]86-*-sysv*)
+i[3-7]86-*-sysv*)
HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; fi`'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; fi` /lib/crtn.o'
;;
-i[3456]86-*-solaris*)
+i[3-7]86-*-solaris*)
HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else ${CC} -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else ${CC} -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
- NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
;;
-i[3456]86-*-sco* | i[3456]86-*-isc*)
+i[3-7]86-*-sco* | i[3-7]86-*-isc*)
# In some configurations gcc does not use crtbegin.o and crtend.o.
# In that case gcc -print-file-name=crtbegin.o will simply print
# crtbegin.o. We create dummy crtbegin.o and crtend.o files to
@@ -112,19 +132,18 @@ i[3456]86-*-sco* | i[3456]86-*-isc*)
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` /lib/crtn.o'
;;
-i[3456]86-*-lynxos*)
+i[3-7]86-*-lynxos*)
HOSTING_CRT0=/lib/init1.o
HOSTING_LIBS="$HOSTING_LIBS"' -lm /lib/initn.o'
;;
-i[3456]86-pc-interix*)
+i[3-7]86-pc-interix*)
HOSTING_CRT0='$$INTERIX_ROOT/usr/lib/crt0.o'
- NATIVE_LIB_DIRS='/usr/local/lib $$INTERIX_ROOT/usr/lib /lib /usr/lib'
HOSTING_LIBS='-L $$X/local_bin -L $$INTERIX_ROOT/usr/lib '"$HOSTING_LIBS"' -lcpsx -lc -lcpsx $$INTERIX_ROOT/usr/lib/psxdll.a $$INTERIX_ROOT/usr/lib/psxdll2.a'
;;
-i[3456]86-*-cygwin*)
- HOSTING_LIBS="$HOSTING_LIBS"' -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`'
+i[3-7]86-*-cygwin*)
+ HOSTING_LIBS="$HOSTING_LIBS"' -lcygwin -L/usr/lib/w32api -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`'
;;
ia64-*-linux-gnu*)
@@ -134,11 +153,6 @@ ia64-*-linux-gnu*)
ia64-*-aix*)
HOSTING_CRT0='-dynamic-linker `egrep "libc.so" \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/libc.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
- NATIVE_LIB_DIRS='/usr/local/lib /usr/lib/ia64l64 /lib /usr/lib'
- ;;
-
-mips*-dec-bsd*)
- HOSTING_CRT0=/usr/lib/crt0.o
;;
mips*-sgi-irix4* | mips*-sgi-irix5*)
@@ -184,6 +198,10 @@ m88*-motorola-sysv3)
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`'
;;
+powerpc64*-*-linux-gnu*)
+ HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld64.so.1,"`
+ ;;
+
powerpc*-*-linux-gnu*)
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"`
;;
@@ -199,7 +217,6 @@ s390-*-linux-gnu*)
sparc*-*-solaris2*)
HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else ${CC} -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else ${CC} -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
- NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
;;
sparc-*-linux-gnu*)
@@ -214,21 +231,17 @@ x86_64-*-linux-gnu*)
HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld-linux-x86-64.so.2,"`
;;
-*-*-freebsd*)
+*-*-freebsd* | *-*-kfreebsd*-gnu)
;;
*-*-linux*)
;;
*-*-netbsd*)
- # NetBSD typically does not use the GCC crtstuff, so ignore it.
- HOSTING_CRT0='-dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o /usr/lib/crtbegin.o'
- HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` /usr/lib/crtend.o'
;;
alpha*-*-*)
HOSTING_CRT0=/usr/ccs/lib/crt0.o
- NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
;;
esac
diff --git a/contrib/binutils/ld/configure.tgt b/contrib/binutils/ld/configure.tgt
index bcdbb04..9b29291 100644
--- a/contrib/binutils/ld/configure.tgt
+++ b/contrib/binutils/ld/configure.tgt
@@ -9,11 +9,14 @@
# targ_extra_emuls additional linker emulations to provide
# targ_extra_libpath additional linker emulations using LIB_PATH
# targ_extra_ofiles additional objects needed by the emulation
+# NATIVE_LIB_DIRS library directories to search on this host
+# (if we are a native or sysrooted linker)
targ_extra_emuls=
targ_extra_ofiles=
case "${targ}" in
+am33_2.0-*-linux*) targ_emul=elf32am33lin ;;
arm-epoc-pe) targ_emul=arm_epoc_pe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
arm-*-wince) targ_emul=armpe ;
@@ -21,11 +24,12 @@ arm-*-wince) targ_emul=armpe ;
arm-*-pe) targ_emul=armpe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
arc-*-elf*) targ_emul=arcelf ;;
-avr-*-*) targ_emul=avr85xx
- targ_extra_emuls="avr1200 avr23xx avr44x4 avr4433 avrmega603 avrmega103 avrmega161 avr1 avr2 avr3 avr4 avr5" ;;
+avr-*-*) targ_emul=avr2
+ targ_extra_emuls="avr1 avr3 avr4 avr5" ;;
cris-*-*aout*) targ_emul=crisaout
targ_extra_emuls="criself crislinux"
targ_extra_libpath=$targ_extra_emuls ;;
+cris-*-linux-gnu*) targ_emul=crislinux ;;
cris-*-*) targ_emul=criself
targ_extra_emuls="crisaout crislinux"
targ_extra_libpath=$targ_extra_emuls ;;
@@ -44,7 +48,7 @@ sparc*-*-aout) targ_emul=sparcaout ;;
sparc*-*-coff) targ_emul=coff_sparc ;;
sparc*-*-elf) targ_emul=elf32_sparc ;;
sparc*-*-sysv4*) targ_emul=elf32_sparc ;;
-sparc64-*-freebsd* | sparcv9-*-freebsd*)
+sparc64-*-freebsd* | sparcv9-*-freebsd* | sparc64-*-kfreebsd*-gnu | sparcv9-*-kfreebsd*-gnu)
targ_emul=elf64_sparc_fbsd
targ_extra_emuls="elf64_sparc elf32_sparc"
targ_extra_libpath=$targ_extra_emuls
@@ -94,6 +98,7 @@ sparc*-wrs-vxworks*) targ_emul=sparcaout ;;
sparc*-*-rtemsaout*) targ_emul=sparcaout ;;
sparc*-*-rtemself*) targ_emul=elf32_sparc ;;
sparc*-*-rtems*) targ_emul=elf32_sparc ;;
+i860-*-coff) targ_emul=coff_i860 ;;
i860-stardent-sysv4* | i860-stardent-elf*)
targ_emul=elf32_i860 ;;
i960-wrs-vxworks5.0*) targ_emul=gld960 ;;
@@ -104,12 +109,16 @@ i960-intel-nindy) targ_emul=gld960 ;;
i960-*-rtems*) targ_emul=gld960coff ;;
i960-*-elf*) targ_emul=elf32_i960 ;;
ia64-*-elf*) targ_emul=elf64_ia64 ;;
-ia64-*-freebsd*) targ_emul=elf64_ia64_fbsd
+ia64-*-freebsd* | ia64-*-kfreebsd*-gnu)
+ targ_emul=elf64_ia64_fbsd
targ_extra_emuls="elf64_ia64" ;;
ia64-*-netbsd*) targ_emul=elf64_ia64 ;;
ia64-*-linux*) targ_emul=elf64_ia64 ;;
ia64-*-aix*) targ_emul=elf64_aix ;;
-m32r-*-*) targ_emul=m32relf ;;
+m32r*le-*-elf*) targ_emul=m32rlelf ;;
+m32r*-*-elf*) targ_emul=m32relf ;;
+m32r*le-*-linux-gnu*) targ_emul=m32rlelf_linux ;;
+m32r*-*-linux-gnu*) targ_emul=m32relf_linux ;;
m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf
targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf
@@ -120,30 +129,34 @@ m68*-ericsson-ose) targ_emul=sun3 ;;
m68*-apple-aux*) targ_emul=m68kaux ;;
*-tandem-none) targ_emul=st2000 ;;
i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
-i[3456]86-*-nto-qnx*) targ_emul=i386nto ;;
-i[3456]86-*-vsta) targ_emul=vsta ;;
-i[3456]86-go32-rtems*) targ_emul=i386go32 ;;
-i[3456]86-*-go32) targ_emul=i386go32 ;;
-i[3456]86-*-msdosdjgpp*) targ_emul=i386go32 ;;
-i[3456]86-*-aix*) targ_emul=i386coff ;;
-i[3456]86-*-sco*) targ_emul=i386coff ;;
-i[3456]86-*-isc*) targ_emul=i386coff ;;
-i[3456]86-*-lynxos*) targ_emul=i386lynx ;;
-i[3456]86-*-coff) targ_emul=i386coff ;;
-i[3456]86-*-rtemscoff*) targ_emul=i386coff ;;
-i[3456]86-*-rtemself*) targ_emul=elf_i386 ;;
-i[3456]86-*-rtems*) targ_emul=elf_i386 ;;
-i[3456]86-*-bsd) targ_emul=i386bsd ;;
-i[3456]86-*-bsd386) targ_emul=i386bsd ;;
-i[3456]86-*-bsdi*) targ_emul=i386bsd ;;
-i[3456]86-*-aout) targ_emul=i386aout ;;
-i[3456]86-*-linux*aout*) targ_emul=i386linux
+i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
+i[3-7]86-*-vsta) targ_emul=vsta ;;
+i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
+i[3-7]86-*-go32) targ_emul=i386go32 ;;
+i[3-7]86-*-msdosdjgpp*) targ_emul=i386go32 ;;
+i[3-7]86-*-aix*) targ_emul=i386coff ;;
+i[3-7]86-*-sco*) targ_emul=i386coff ;;
+i[3-7]86-*-isc*) targ_emul=i386coff ;;
+i[3-7]86-*-lynxos*) targ_emul=i386lynx ;;
+i[3-7]86-*-coff) targ_emul=i386coff ;;
+i[3-7]86-*-rtemscoff*) targ_emul=i386coff ;;
+i[3-7]86-*-rtemself*) targ_emul=elf_i386 ;;
+i[3-7]86-*-rtems*) targ_emul=elf_i386 ;;
+i[3-7]86-*-aros*) targ_emul=elf_i386 ;;
+i[3-7]86-*-bsd) targ_emul=i386bsd ;;
+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-*-linux*aout*) targ_emul=i386linux
targ_extra_emuls=elf_i386
tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
;;
-i[3456]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
-i[3456]86-*-linux-gnu*) targ_emul=elf_i386
+i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
+i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
targ_extra_emuls=i386linux
+ if test x${want64} = xtrue; then
+ targ_extra_emuls="$targ_extra_emuls elf_x86_64"
+ fi
tdir_i386linux=${targ_alias}aout
;;
x86_64-*-linux-gnu*) targ_emul=elf_x86_64
@@ -152,21 +165,24 @@ x86_64-*-linux-gnu*) targ_emul=elf_x86_64
tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'`
;;
-i[3456]86-*-sysv[45]*) targ_emul=elf_i386 ;;
-i[3456]86-*-solaris2*) targ_emul=elf_i386_ldso
+i[3-7]86-*-sysv[45]*) targ_emul=elf_i386 ;;
+i[3-7]86-*-solaris2*) targ_emul=elf_i386_ldso
targ_extra_emuls="elf_i386"
;;
-i[3456]86-*-unixware) targ_emul=elf_i386 ;;
-i[3456]86-*-solaris*) targ_emul=elf_i386_ldso
+i[3-7]86-*-unixware) targ_emul=elf_i386 ;;
+i[3-7]86-*-solaris*) targ_emul=elf_i386_ldso
targ_extra_emuls="elf_i386"
;;
-i[3456]86-*-netbsdelf*) targ_emul=elf_i386
+i[3-7]86-*-netbsdelf* | \
+i[3-7]86-*-netbsd*-gnu* | \
+i[3-7]86-*-knetbsd*-gnu)
+ targ_emul=elf_i386
targ_extra_emuls=i386nbsd
;;
-i[3456]86-*-netbsdpe*) targ_emul=i386pe
+i[3-7]86-*-netbsdpe*) targ_emul=i386pe
targ_extra_ofiles="deffilep.o pe-dll.o"
;;
-i[3456]86-*-netbsd*) targ_emul=i386nbsd
+i[3-7]86-*-netbsd*) targ_emul=i386nbsd
targ_extra_emuls=elf_i386
;;
x86_64-*-netbsd*) targ_emul=elf_x86_64
@@ -181,37 +197,41 @@ x86_64-*-netbsd*) targ_emul=elf_x86_64
;;
esac
;;
-i[3456]86-*-netware) targ_emul=i386nw ;;
-i[3456]86-*-elf*) targ_emul=elf_i386 ;;
-i[3456]86-*-freebsdaout* | i[3456]86-*-freebsd[12].* | i[3456]86-*-freebsd[12])
+i[3-7]86-*-netware) targ_emul=i386nw ;;
+i[3-7]86-*-elf*) targ_emul=elf_i386 ;;
+i[3-7]86-*-kaos*) targ_emul=elf_i386 ;;
+i[3-7]86-*-freebsdaout* | i[3-7]86-*-freebsd[12].* | i[3-7]86-*-freebsd[12])
targ_emul=i386bsd ;;
-i[3456]86-*-freebsd*) targ_emul=elf_i386_fbsd
+i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
+ targ_emul=elf_i386_fbsd
targ_extra_emuls="elf_i386 i386bsd" ;;
-x86_64-*-freebsd*) targ_emul=elf_x86_64_fbsd
+x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
+ targ_emul=elf_x86_64_fbsd
targ_extra_emuls="elf_i386_fbsd elf_x86_64 elf_i386"
tdir_elf_i386=`echo ${targ_alias} \
| sed -e 's/x86_64/i386/'`
;;
-i[3456]86-*-sysv*) targ_emul=i386coff ;;
-i[3456]86-*-ptx*) targ_emul=i386coff ;;
-i[3456]86-*-mach*) targ_emul=i386mach ;;
-i[3456]86-*-gnu*) targ_emul=elf_i386 ;;
-i[3456]86-*-msdos*) targ_emul=i386msdos; targ_extra_emuls=i386aout ;;
-i[3456]86-*-moss*) targ_emul=i386moss; targ_extra_emuls=i386msdos ;;
-i[3456]86-*-winnt*) targ_emul=i386pe ;
+i[3-7]86-*-sysv*) targ_emul=i386coff ;;
+i[3-7]86-*-ptx*) targ_emul=i386coff ;;
+i[3-7]86-*-mach*) targ_emul=i386mach ;;
+i[3-7]86-*-gnu*) targ_emul=elf_i386 ;;
+i[3-7]86-*-msdos*) targ_emul=i386msdos; targ_extra_emuls=i386aout ;;
+i[3-7]86-*-moss*) targ_emul=i386moss; targ_extra_emuls=i386msdos ;;
+i[3-7]86-*-winnt*) targ_emul=i386pe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-i[3456]86-*-pe) targ_emul=i386pe ;
+i[3-7]86-*-pe) targ_emul=i386pe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-i[3456]86-*-cygwin*) targ_emul=i386pe ;
- targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-i[3456]86-*-mingw32*) targ_emul=i386pe ;
+i[3-7]86-*-cygwin*) targ_emul=i386pe ;
+ targ_extra_ofiles="deffilep.o pe-dll.o"
+ test "$targ" != "$host" && LIB_PATH='${tooldir}/lib/w32api' ;;
+i[3-7]86-*-mingw32*) targ_emul=i386pe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-i[3456]86-*-interix*) targ_emul=i386pe_posix;
+i[3-7]86-*-interix*) targ_emul=i386pe_posix;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-i[3456]86-*-beospe*) targ_emul=i386beos ;;
-i[3456]86-*-beos*) targ_emul=elf_i386_be ;;
-i[3456]86-*-vxworks*) targ_emul=i386aout ;;
-i[3456]86-*-chaos) targ_emul=elf_i386_chaos ;;
+i[3-7]86-*-beospe*) targ_emul=i386beos ;;
+i[3-7]86-*-beos*) targ_emul=elf_i386_be ;;
+i[3-7]86-*-vxworks*) targ_emul=elf_i386 ;;
+i[3-7]86-*-chaos) targ_emul=elf_i386_chaos ;;
m8*-*-*) targ_emul=m88kbcs ;;
a29k-*-udi) targ_emul=sa29200 ;;
a29k-*-ebmon) targ_emul=ebmon29k ;;
@@ -220,8 +240,8 @@ a29k-*-*) targ_emul=a29k ;;
arm-*-aout | armel-*-aout) targ_emul=armaoutl ;;
armeb-*-aout) targ_emul=armaoutb ;;
arm-*-coff) targ_emul=armcoff ;;
-arm-*-vxworks) targ_emul=armcoff ;;
-arm-*-freebsd*) targ_emul=armelf_fbsd
+arm-*-freebsd* | arm-*-kfreebsd*-gnu)
+ targ_emul=armelf_fbsd
targ_extra_emuls="armelf" ;;
armeb-*-netbsdelf*) targ_emul=armelfb_nbsd;
targ_extra_emuls="armelf_nbsd armelf armnbsd" ;;
@@ -229,17 +249,23 @@ arm-*-netbsdelf*) targ_emul=armelf_nbsd;
targ_extra_emuls="armelfb_nbsd armelf armnbsd" ;;
arm-*-netbsd*) targ_emul=armnbsd;
targ_extra_emuls="armelf armelf_nbsd armelfb_nbsd" ;;
+arm-*-nto*) targ_emul=armnto ;;
arm-*-openbsd*) targ_emul=armnbsd ;;
arm-*-rtems*) targ_emul=armelf ;;
-arm-*-elf) targ_emul=armelf ;;
+armeb-*-elf) targ_emul=armelfb ;;
+arm-*-elf | arm-*-vxworks)
+ targ_emul=armelf ;;
+arm-*-kaos*) targ_emul=armelf ;;
arm9e-*-elf) targ_emul=armelf ;;
arm-*-oabi) targ_emul=armelf_oabi ;;
+arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
arm*-*-conix*) targ_emul=armelf ;;
thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
strongarm-*-coff) targ_emul=armcoff ;;
strongarm-*-elf) targ_emul=armelf ;;
+strongarm-*-kaos*) targ_emul=armelf ;;
thumb-*-coff) targ_emul=armcoff ;;
thumb-*-elf) targ_emul=armelf ;;
thumb-*-oabi) targ_emul=armelf_oabi ;;
@@ -250,13 +276,13 @@ thumb-*-pe) targ_emul=armpe ;
xscale-*-coff) targ_emul=armcoff ;;
xscale-*-elf) targ_emul=armelf ;;
h8300-*-hms* | h8300-*-coff* | h8300-*-rtems*)
- targ_emul=h8300; targ_extra_emuls="h8300h h8300s"
+ targ_emul=h8300; targ_extra_emuls="h8300h h8300s h8300hn h8300sn h8300sx h8300sxn"
;;
h8300-*-elf*)
targ_emul=h8300elf;
- targ_extra_emuls="h8300helf h8300self"
+ targ_extra_emuls="h8300helf h8300self h8300hnelf h8300snelf h8300sxelf h8300sxnelf"
;;
-h8500-*-hms* | h8500-*-coff*)
+h8500-*-hms* | h8500-*-coff* | h8500-*-rtems*)
targ_emul=h8500
targ_extra_emuls="h8500s h8500b h8500m h8500c"
;;
@@ -265,6 +291,13 @@ sh-*-linux*)
targ_extra_emuls=shelf_linux
targ_extra_libpath=shelf_linux
;;
+sh64eb-*-linux*) targ_emul=shelf32_linux
+ targ_extra_emuls="shlelf32_linux"
+ ;;
+sh64-*-linux*) targ_emul=shlelf32_linux
+ targ_extra_emuls="shelf32_linux"
+ targ_extra_libpath=shelf32_linux
+ ;;
sh*eb-*-linux*)
targ_emul=shelf_linux
;;
@@ -287,7 +320,7 @@ sh64-*-netbsd*)
targ_emul=shelf64_nbsd
targ_extra_emuls="shlelf64_nbsd shelf32_nbsd shlelf32_nbsd shelf_nbsd shlelf_nbsd"
;;
-sh*le-*-netbsdelf*)
+sh*l*-*-netbsdelf*)
targ_emul=shlelf_nbsd
targ_extra_emuls=shelf_nbsd
;;
@@ -295,17 +328,21 @@ sh*-*-netbsdelf*)
targ_emul=shelf_nbsd
targ_extra_emuls=shlelf_nbsd
;;
-shle*-*-elf* | sh[1234]*le*-*-elf)
+shle*-*-elf* | sh[1234]*le*-*-elf | shle*-*-kaos*)
targ_emul=shlelf
targ_extra_emuls="shelf shl sh"
;;
-sh-*-elf* | sh[1234]*-*-elf | sh-*-rtemself*)
+sh-*-rtemscoff*) targ_emul=sh; targ_extra_emuls=shl ;;
+sh-*-elf* | sh[1234]*-*-elf | sh-*-rtems* | sh-*-kaos* | sh-*-vxworks)
targ_emul=shelf
targ_extra_emuls="shlelf sh shl"
;;
+sh-*-nto*) targ_emul=shelf_nto
+ targ_extra_emuls=shlelf_nto
+ ;;
sh-*-pe) targ_emul=shpe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
-sh-*-*|sh-*-rtems*) targ_emul=sh; targ_extra_emuls=shl ;;
+sh-*-*) targ_emul=sh; targ_extra_emuls=shl ;;
sh64le-*-elf*)
targ_emul=shlelf
targ_extra_emuls="shelf shlelf32 shelf32 shlelf64 shelf64"
@@ -331,6 +368,7 @@ m68k-*-linux-gnu*) targ_emul=m68kelf
targ_extra_emuls=m68klinux
tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
;;
+m68k-*-uclinux*) targ_emul=m68kelf ;;
m68*-*-gnu*) targ_emul=m68kelf ;;
m68*-*-lynxos*) targ_emul=m68klynx ;;
m68*-*-netbsd*4k*) targ_emul=m68k4knbsd
@@ -357,6 +395,7 @@ vax-*-netbsdelf*) targ_emul=elf32vax
vax-*-netbsdaout* | vax-*-netbsd*)
targ_emul=vaxnbsd
targ_extra_emuls=elf32vax ;;
+vax-*-linux-gnu*) targ_emul=elf32vax ;;
mips*-*-pe) targ_emul=mipspe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
mips*-dec-ultrix*) targ_emul=mipslit ;;
@@ -364,11 +403,11 @@ mips*-dec-osf*) targ_emul=mipslit ;;
mips*-sgi-irix5*) targ_emul=elf32bsmip ;;
mips*-sgi-irix6*) targ_emul=elf32bmipn32
targ_extra_emuls="elf32bsmip elf64bmip"
+ targ_extra_libpath=$targ_extra_emuls
;;
mips*-sgi-irix*) targ_emul=mipsbig ;;
mips*el-*-ecoff*) targ_emul=mipsidtl ;;
mips*-*-ecoff*) targ_emul=mipsidt ;;
-mips*-dec-bsd*) targ_emul=mipsbsd ;;
mips*el-*-netbsd*) targ_emul=elf32lmip
targ_extra_emuls="elf32bmip"
;;
@@ -387,12 +426,20 @@ mips*-*-elf*) targ_emul=elf32ebmip ;;
mips*el-*-rtems*) targ_emul=elf32elmip ;;
mips*-*-rtems*) targ_emul=elf32ebmip ;;
mips*el-*-vxworks*) targ_emul=elf32elmip ;;
-mips*-*-vxworks*) targ_emul=elf32ebmip ;;
+mips*-*-vxworks*) targ_emul=elf32ebmip
+ targ_extra_emuls="elf32elmip" ;;
+mips*-*-windiss) targ_emul=elf32mipswindiss ;;
+mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+ ;;
+mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+ ;;
mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
- targ_extra_emuls="elf32btsmip elf64ltsmip elf64btsmip"
+ targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
;;
mips*-*-linux-gnu*) targ_emul=elf32btsmip
- targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip"
+ targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
;;
mips*-*-lnews*) targ_emul=mipslnews ;;
mips*-*-sysv4*) targ_emul=elf32btsmip ;;
@@ -401,7 +448,10 @@ mmix-*-*) targ_emul=mmo
;;
mn10200-*-*) targ_emul=mn10200 ;;
mn10300-*-*) targ_emul=mn10300 ;;
-alpha*-*-freebsd*) targ_emul=elf64alpha_fbsd
+msp430-*-*) targ_emul=msp430x110
+ targ_extra_emuls="msp430x112 msp430x1101 msp430x1111 msp430x1121 msp430x1122 msp430x1132 msp430x122 msp430x123 msp430x1222 msp430x1232 msp430x133 msp430x135 msp430x1331 msp430x1351 msp430x147 msp430x148 msp430x149 msp430x155 msp430x156 msp430x157 msp430x167 msp430x168 msp430x169 msp430x311 msp430x312 msp430x313 msp430x314 msp430x315 msp430x323 msp430x325 msp430x336 msp430x337 msp430x412 msp430x413 msp430xE423 msp430xE425 msp430xE427 msp430xW423 msp430xW425 msp430xW427 msp430x435 msp430x436 msp430x437 msp430x447 msp430x448 msp430x449" ;;
+alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
+ targ_emul=elf64alpha_fbsd
targ_extra_emuls="elf64alpha alpha"
tdir_alpha=`echo ${targ_alias} | sed -e 's/freebsd/freebsdecoff/'`
;;
@@ -422,11 +472,12 @@ ns32k-*-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd ;;
openrisc-*-*) targ_emul=elf32openrisc ;;
or32-*-coff) targ_emul=or32 ;;
or32-*-elf) targ_emul=or32elf ;;
-or32-*-rtems) targ_emul=or32 ;;
+or32-*-rtems*) targ_emul=or32elf ;;
pdp11-*-*) targ_emul=pdp11 ;;
pjl*-*-*) targ_emul=pjlelf ; targ_extra_emuls="elf_i386" ;;
pj*-*-*) targ_emul=pjelf ;;
-powerpc-*-freebsd*) targ_emul=elf32ppc_fbsd;
+powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu)
+ targ_emul=elf32ppc_fbsd;
targ_extra_emuls="elf32ppc elf32ppcsim";
targ_extra_libpath=elf32ppc;
tdir_elf32ppcsim=`echo ${targ_alias} | sed -e 's/ppc/ppcsim/'`
@@ -435,13 +486,18 @@ powerpc*-*-linux*)
case "${targ}" in
*64*) targ_emul=elf64ppc
targ_extra_emuls="elf32ppclinux elf32ppc elf32ppcsim"
- targ_extra_libpath=elf32ppclinux
+ targ_extra_libpath="elf32ppclinux elf32ppc"
tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'`
tdir_elf32ppclinux=$tdir_elf32ppc
tdir_elf32ppcsim=$tdir_elf32ppc ;;
*) targ_emul=elf32ppclinux
targ_extra_emuls="elf32ppc elf32ppcsim"
- targ_extra_libpath=elf32ppc ;;
+ targ_extra_libpath=elf32ppc
+ if test "${want64}" = "true"; then
+ targ_extra_emuls="$targ_extra_emuls elf64ppc"
+ targ_extra_libpath="$targ_extra_libpath elf64ppc"
+ fi
+ ;;
esac ;;
powerpc*le-*-elf* | powerpc*le-*-eabi* | powerpc*le-*-solaris* \
| powerpc*le-*-sysv* | powerpc*le-*-vxworks*)
@@ -454,7 +510,7 @@ powerpc*le-*-elf* | powerpc*le-*-eabi* | powerpc*le-*-solaris* \
targ_extra_emuls="elf32ppcsim" ;;
esac ;;
powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \
- | powerpc*-*-netbsd* | powerpc-*-openbsd* | powerpc*-*-vxworks*)
+ | powerpc*-*-netbsd* | powerpc-*-openbsd* | powerpc*-*-vxworks* | powerpc*-*-kaos*)
case "${targ}" in
*64*) targ_emul=elf64ppc
targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim"
@@ -464,6 +520,8 @@ powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \
*) targ_emul=elf32ppc
targ_extra_emuls="elf32ppclinux elf32ppcsim" ;;
esac ;;
+powerpc-*-nto*) targ_emul=elf32ppcnto ;;
+powerpcle-*-nto*) targ_emul=elf32lppcnto ;;
powerpcle-*-rtems*) targ_emul=elf32leppc ;;
powerpc-*-rtems*) targ_emul=elf32ppc ;;
powerpc-*-macos*) targ_emul=ppcmacos ;;
@@ -479,14 +537,18 @@ rs6000-*-aix5*) targ_emul=aix5rs6 ;;
rs6000-*-aix*) targ_emul=aixrs6 ;;
tic30-*-*aout*) targ_emul=tic30aout ;;
tic30-*-*coff*) targ_emul=tic30coff ;;
+tic4x-*-* | c4x-*-*) targ_emul=tic4xcoff ; targ_extra_emuls="tic3xcoff tic3xcoff_onchip" ;;
tic54x-*-* | c54x*-*-*) targ_emul=tic54xcoff ;;
tic80-*-*) targ_emul=tic80coff ;;
v850-*-*) targ_emul=v850 ;;
v850e-*-*) targ_emul=v850 ;;
v850ea-*-*) targ_emul=v850 ;;
-frv-*-*) targ_emul=elf32frv ;;
+iq2000-*-elf) targ_emul=elf32iq2000 ; targ_extra_emuls="elf32iq10" ;;
+frv-*-*linux*) targ_emul=elf32frvfd ;;
+frv-*-*) targ_emul=elf32frv ; targ_extra_emuls="elf32frvfd" ;;
w65-*-*) targ_emul=w65 ;;
xstormy16-*-*) targ_emul=elf32xstormy16 ;;
+xtensa-*-*) targ_emul=elf32xtensa;;
fr30-*-*) targ_emul=elf32fr30 ;;
mcore-*-pe) targ_emul=mcorepe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
@@ -502,6 +564,7 @@ s390-*-linux*) targ_emul=elf_s390
tdir_elf64_s390=`echo ${targ_alias} | sed -e 's/s390/s390x/'`
fi ;;
*-*-ieee*) targ_emul=vanilla ;;
+ip2k-*-elf) targ_emul=elf32ip2k ;;
*)
echo 2>&1 "*** ld does not support target ${targ}"
@@ -509,3 +572,53 @@ s390-*-linux*) targ_emul=elf_s390
exit 1
esac
+
+NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib'
+case "${target}" in
+
+*-*-freebsd*)
+ NATIVE_LIB_DIRS='/lib /usr/lib /usr/local/lib'
+ ;;
+
+hppa*64*-*-hpux11*)
+ NATIVE_LIB_DIRS=/usr/lib/pa20_64
+ ;;
+
+i[3-7]86-*-sysv4*)
+ NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
+ ;;
+
+i[3-7]86-*-solaris*)
+ NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
+ ;;
+
+i[3-7]86-pc-interix*)
+ NATIVE_LIB_DIRS='/usr/local/lib $$INTERIX_ROOT/usr/lib /lib /usr/lib'
+ ;;
+
+ia64-*-aix*)
+ NATIVE_LIB_DIRS='/usr/local/lib /usr/lib/ia64l64 /lib /usr/lib'
+ ;;
+
+sparc*-*-solaris2*)
+ NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
+ ;;
+
+i[03-9x]86-*-cygwin*)
+ NATIVE_LIB_DIRS='/usr/lib /usr/lib/w32api'
+ ;;
+
+*-*-linux*)
+ ;;
+
+*-*-freebsd*)
+ ;;
+
+*-*-netbsd*)
+ ;;
+
+alpha*-*-*)
+ NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib'
+ ;;
+
+esac
diff --git a/contrib/binutils/ld/emulparams/elf64alpha.sh b/contrib/binutils/ld/emulparams/elf64alpha.sh
index 3dd28ef..093c8df 100644
--- a/contrib/binutils/ld/emulparams/elf64alpha.sh
+++ b/contrib/binutils/ld/emulparams/elf64alpha.sh
@@ -2,6 +2,7 @@ ENTRY=_start
SCRIPT_NAME=elf
ELFSIZE=64
TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=alphaelf
OUTPUT_FORMAT="elf64-alpha"
TEXT_START_ADDR="0x120000000"
MAXPAGESIZE=0x10000
@@ -10,6 +11,7 @@ NONPAGED_TEXT_START_ADDR="0x120000000"
ARCH=alpha
MACHINE=
GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
DATA_PLT=
# Note that the number is always big-endian, thus we have to
# reverse the digit string.
@@ -17,54 +19,3 @@ NOP=0x0000fe2f1f04ff47 # unop; nop
OTHER_READONLY_SECTIONS="
.reginfo ${RELOCATING-0} : { *(.reginfo) }"
-
-# This code gets inserted into the generic elf32.sc linker script
-# and allows us to define our own command line switches.
-PARSE_AND_LIST_PROLOGUE='
-#define OPTION_TASO 300
-/* Set the start address as in the Tru64 ld */
-#define ALPHA_TEXT_START_32BIT 0x12000000
-
-static int elf64alpha_32bit = 0;
-
-struct ld_emulation_xfer_struct ld_elf64alpha_emulation;
-static void gld_elf64alpha_finish PARAMS ((void));
-'
-
-PARSE_AND_LIST_LONGOPTS='
- {"taso", no_argument, NULL, OPTION_TASO},
-'
-
-PARSE_AND_LIST_OPTIONS='
- fprintf (file, _(" -taso\t\t\tLoad executable in the lower 31-bit addressable\n"));
- fprintf (file, _("\t\t\t virtual address range\n"));
-'
-
-PARSE_AND_LIST_ARGS_CASES='
- case EOF:
- if (elf64alpha_32bit && !link_info.shared && !link_info.relocateable)
- {
- lang_section_start (".interp",
- exp_binop ('\''+'\'',
- exp_intop (ALPHA_TEXT_START_32BIT),
- exp_nameop (SIZEOF_HEADERS, NULL)));
- ld_elf64alpha_emulation.finish = gld_elf64alpha_finish;
- }
- return 0;
-
- case OPTION_TASO:
- elf64alpha_32bit = 1;
- break;
-'
-
-PARSE_AND_LIST_EPILOGUE='
-#include "elf/internal.h"
-#include "elf/alpha.h"
-#include "elf-bfd.h"
-
-static void
-gld_elf64alpha_finish()
-{
- elf_elfheader (output_bfd)->e_flags |= EF_ALPHA_32BIT;
-}
-'
diff --git a/contrib/binutils/ld/ld.1 b/contrib/binutils/ld/ld.1
index 9d7a53e..87ee202 100644
--- a/contrib/binutils/ld/ld.1
+++ b/contrib/binutils/ld/ld.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
+.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -128,7 +128,7 @@
.\" ========================================================================
.\"
.IX Title "LD 1"
-.TH LD 1 "2002-10-30" "binutils-2.13" "GNU Development Tools"
+.TH LD 1 "2004-05-17" "binutils-2.15" "GNU Development Tools"
.SH "NAME"
ld \- Using LD, the GNU linker
.SH "SYNOPSIS"
@@ -202,7 +202,7 @@ and the script command language. If \fIno\fR binary input files at all
are specified, the linker does not produce any output, and issues the
message \fBNo input files\fR.
.PP
-If the linker can not recognize the format of an object file, it will
+If the linker cannot recognize the format of an object file, it will
assume that it is a linker script. A script specified in this way
augments the main linker script used for the link (either the default
linker script or the one specified by using \fB\-T\fR). This feature
@@ -219,7 +219,7 @@ option that requires them.
.PP
For options whose names are multiple letters, either one dash or two can
precede the option name; for example, \fB\-trace\-symbol\fR and
-\&\fB\-\-trace\-symbol\fR are equivalent. Note \- there is one exception to
+\&\fB\-\-trace\-symbol\fR are equivalent. Note\-\-\-there is one exception to
this rule. Multiple letter options that start with a lower case 'o' can
only be preceeded by two dashes. This is to reduce confusion with the
\&\fB\-o\fR option. So for example \fB\-omagic\fR sets the output file
@@ -233,8 +233,8 @@ immediately following the option that requires them. For example,
Unique abbreviations of the names of multiple-letter options are
accepted.
.PP
-Note \- if the linker is being invoked indirectly, via a compiler driver
-(eg \fBgcc\fR) then all the linker command line options should be
+Note\-\-\-if the linker is being invoked indirectly, via a compiler driver
+(e.g. \fBgcc\fR) then all the linker command line options should be
prefixed by \fB\-Wl,\fR (or whatever is appropriate for the particular
compiler driver) like this:
.PP
@@ -406,11 +406,13 @@ used to select a subset of the symbols provided by the object
.Sp
Some older linkers used the \fB\-F\fR option throughout a compilation
toolchain for specifying object-file format for both input and output
-object files. The \s-1GNU\s0 linker uses other mechanisms for this
-purpose: the \fB\-b\fR, \fB\-\-format\fR, \fB\-\-oformat\fR options, the
+object files.
+The \s-1GNU\s0 linker uses other mechanisms for this purpose: the
+\&\fB\-b\fR, \fB\-\-format\fR, \fB\-\-oformat\fR options, the
\&\f(CW\*(C`TARGET\*(C'\fR command in linker scripts, and the \f(CW\*(C`GNUTARGET\*(C'\fR
-environment variable. The \s-1GNU\s0 linker will ignore the \fB\-F\fR
-option when not creating an \s-1ELF\s0 shared object.
+environment variable.
+The \s-1GNU\s0 linker will ignore the \fB\-F\fR option when not
+creating an \s-1ELF\s0 shared object.
.IP "\fB\-fini\fR \fIname\fR" 4
.IX Item "-fini name"
When creating an \s-1ELF\s0 executable or shared object, call \s-1NAME\s0 when the
@@ -497,6 +499,9 @@ on the command line are searched before the default directories. All
\&\fB\-L\fR options apply to all \fB\-l\fR options, regardless of the
order in which the options appear.
.Sp
+If \fIsearchdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
+by the \fIsysroot prefix\fR, a path specified when the linker is configured.
+.Sp
The default set of paths searched (without being specified with
\&\fB\-L\fR) depends on which emulation mode \fBld\fR is using, and in
some cases also on how it was configured.
@@ -523,11 +528,11 @@ configured.
Print a link map to the standard output. A link map provides
information about the link, including the following:
.RS 4
-.IP "\(bu" 4
+.IP "*" 4
Where object files and symbols are mapped into memory.
-.IP "\(bu" 4
+.IP "*" 4
How common symbols are allocated.
-.IP "\(bu" 4
+.IP "*" 4
All archive members included in the link, with a mention of the symbol
which caused the archive member to be brought in.
.RE
@@ -548,8 +553,17 @@ Turn off page alignment of sections, and mark the output as
.IX Item "--omagic"
.PD
Set the text and data sections to be readable and writable. Also, do
-not page-align the data segment. If the output format supports Unix
-style magic numbers, mark the output as \f(CW\*(C`OMAGIC\*(C'\fR.
+not page-align the data segment, and disable linking against shared
+libraries. If the output format supports Unix style magic numbers,
+mark the output as \f(CW\*(C`OMAGIC\*(C'\fR. Note: Although a writable text section
+is allowed for PE-COFF targets, it does not conform to the format
+specification published by Microsoft.
+.IP "\fB\-\-no\-omagic\fR" 4
+.IX Item "--no-omagic"
+This option negates most of the effects of the \fB\-N\fR option. It
+sets the text section to be read\-only, and forces the data segment to
+be page\-aligned. Note \- this option does not enable linking against
+shared libraries. Use \fB\-Bdynamic\fR for this.
.IP "\fB\-o\fR \fIoutput\fR" 4
.IX Item "-o output"
.PD 0
@@ -579,8 +593,8 @@ This option is currently only supported on \s-1ELF\s0 platforms.
.IP "\fB\-r\fR" 4
.IX Item "-r"
.PD 0
-.IP "\fB\-\-relocateable\fR" 4
-.IX Item "--relocateable"
+.IP "\fB\-\-relocatable\fR" 4
+.IX Item "--relocatable"
.PD
Generate relocatable output\-\-\-i.e., generate an output file that can in
turn serve as input to \fBld\fR. This is often called \fIpartial
@@ -719,29 +733,69 @@ Add \fIpath\fR to the default library search path. This option exists
for Solaris compatibility.
.IP "\fB\-z\fR \fIkeyword\fR" 4
.IX Item "-z keyword"
-The recognized keywords are \f(CW\*(C`initfirst\*(C'\fR, \f(CW\*(C`interpose\*(C'\fR,
-\&\f(CW\*(C`loadfltr\*(C'\fR, \f(CW\*(C`nodefaultlib\*(C'\fR, \f(CW\*(C`nodelete\*(C'\fR, \f(CW\*(C`nodlopen\*(C'\fR,
-\&\f(CW\*(C`nodump\*(C'\fR, \f(CW\*(C`now\*(C'\fR, \f(CW\*(C`origin\*(C'\fR, \f(CW\*(C`combreloc\*(C'\fR, \f(CW\*(C`nocombreloc\*(C'\fR
-and \f(CW\*(C`nocopyreloc\*(C'\fR.
-The other keywords are
-ignored for Solaris compatibility. \f(CW\*(C`initfirst\*(C'\fR marks the object
-to be initialized first at runtime before any other objects.
-\&\f(CW\*(C`interpose\*(C'\fR marks the object that its symbol table interposes
-before all symbols but the primary executable. \f(CW\*(C`loadfltr\*(C'\fR marks
-the object that its filtees be processed immediately at runtime.
-\&\f(CW\*(C`nodefaultlib\*(C'\fR marks the object that the search for dependencies
-of this object will ignore any default library search paths.
-\&\f(CW\*(C`nodelete\*(C'\fR marks the object shouldn't be unloaded at runtime.
-\&\f(CW\*(C`nodlopen\*(C'\fR marks the object not available to \f(CW\*(C`dlopen\*(C'\fR.
-\&\f(CW\*(C`nodump\*(C'\fR marks the object can not be dumped by \f(CW\*(C`dldump\*(C'\fR.
-\&\f(CW\*(C`now\*(C'\fR marks the object with the non-lazy runtime binding.
-\&\f(CW\*(C`origin\*(C'\fR marks the object may contain \f(CW$ORIGIN\fR.
-\&\f(CW\*(C`defs\*(C'\fR disallows undefined symbols.
-\&\f(CW\*(C`muldefs\*(C'\fR allows multiple definitions.
-\&\f(CW\*(C`combreloc\*(C'\fR combines multiple reloc sections and sorts them
-to make dynamic symbol lookup caching possible.
-\&\f(CW\*(C`nocombreloc\*(C'\fR disables multiple reloc sections combining.
-\&\f(CW\*(C`nocopyreloc\*(C'\fR disables production of copy relocs.
+The recognized keywords are:
+.RS 4
+.IP "\fBcombreloc\fR" 4
+.IX Item "combreloc"
+Combines multiple reloc sections and sorts them to make dynamic symbol
+lookup caching possible.
+.IP "\fBdefs\fR" 4
+.IX Item "defs"
+Disallows undefined symbols in object files. Undefined symbols in
+shared libraries are still allowed.
+.IP "\fBinitfirst\fR" 4
+.IX Item "initfirst"
+This option is only meaningful when building a shared object.
+It marks the object so that its runtime initialization will occur
+before the runtime initialization of any other objects brought into
+the process at the same time. Similarly the runtime finalization of
+the object will occur after the runtime finalization of any other
+objects.
+.IP "\fBinterpose\fR" 4
+.IX Item "interpose"
+Marks the object that its symbol table interposes before all symbols
+but the primary executable.
+.IP "\fBloadfltr\fR" 4
+.IX Item "loadfltr"
+Marks the object that its filters be processed immediately at
+runtime.
+.IP "\fBmuldefs\fR" 4
+.IX Item "muldefs"
+Allows multiple definitions.
+.IP "\fBnocombreloc\fR" 4
+.IX Item "nocombreloc"
+Disables multiple reloc sections combining.
+.IP "\fBnocopyreloc\fR" 4
+.IX Item "nocopyreloc"
+Disables production of copy relocs.
+.IP "\fBnodefaultlib\fR" 4
+.IX Item "nodefaultlib"
+Marks the object that the search for dependencies of this object will
+ignore any default library search paths.
+.IP "\fBnodelete\fR" 4
+.IX Item "nodelete"
+Marks the object shouldn't be unloaded at runtime.
+.IP "\fBnodlopen\fR" 4
+.IX Item "nodlopen"
+Marks the object not available to \f(CW\*(C`dlopen\*(C'\fR.
+.IP "\fBnodump\fR" 4
+.IX Item "nodump"
+Marks the object can not be dumped by \f(CW\*(C`dldump\*(C'\fR.
+.IP "\fBnow\fR" 4
+.IX Item "now"
+When generating an executable or shared library, mark it to tell the
+dynamic linker to resolve all symbols when the program is started, or
+when the shared library is linked to using dlopen, instead of
+deferring function call resolution to the point when the function is
+first called.
+.IP "\fBorigin\fR" 4
+.IX Item "origin"
+Marks the object may contain \f(CW$ORIGIN\fR.
+.RE
+.RS 4
+.Sp
+Other keywords are ignored for Solaris compatibility.
+.RE
.IP "\fB\-(\fR \fIarchives\fR \fB\-)\fR" 4
.IX Item "-( archives -)"
.PD 0
@@ -763,6 +817,32 @@ resolved.
Using this option has a significant performance cost. It is best to use
it only when there are unavoidable circular references between two or
more archives.
+.IP "\fB\-\-accept\-unknown\-input\-arch\fR" 4
+.IX Item "--accept-unknown-input-arch"
+.PD 0
+.IP "\fB\-\-no\-accept\-unknown\-input\-arch\fR" 4
+.IX Item "--no-accept-unknown-input-arch"
+.PD
+Tells the linker to accept input files whose architecture cannot be
+recognised. The assumption is that the user knows what they are doing
+and deliberately wants to link in these unknown input files. This was
+the default behaviour of the linker, before release 2.14. The default
+behaviour from release 2.14 onwards is to reject such input files, and
+so the \fB\-\-accept\-unknown\-input\-arch\fR option has been added to
+restore the old behaviour.
+.IP "\fB\-\-as\-needed\fR" 4
+.IX Item "--as-needed"
+.PD 0
+.IP "\fB\-\-no\-as\-needed\fR" 4
+.IX Item "--no-as-needed"
+.PD
+This option affects \s-1ELF\s0 \s-1DT_NEEDED\s0 tags for dynamic libraries mentioned
+on the command line after the \fB\-\-as\-needed\fR option. Normally,
+the linker will add a \s-1DT_NEEDED\s0 tag for each dynamic library mentioned
+on the command line, regardless of whether the library is actually
+needed. \fB\-\-as\-needed\fR causes \s-1DT_NEEDED\s0 tags to only be emitted
+for libraries that satisfy some reference from regular objects.
+\&\fB\-\-no\-as\-needed\fR restores the default behaviour.
.IP "\fB\-assert\fR \fIkeyword\fR" 4
.IX Item "-assert keyword"
This option is ignored for SunOS compatibility.
@@ -785,8 +865,8 @@ multiple times on the command line: it affects library searching for
Set the \f(CW\*(C`DF_1_GROUP\*(C'\fR flag in the \f(CW\*(C`DT_FLAGS_1\*(C'\fR entry in the dynamic
section. This causes the runtime linker to handle lookups in this
object and its dependencies to be performed only inside the group.
-\&\fB\-\-no\-undefined\fR is implied. This option is only meaningful on \s-1ELF\s0
-platforms which support shared libraries.
+\&\fB\-\-unresolved\-symbols=report\-all\fR is implied. This option is
+only meaningful on \s-1ELF\s0 platforms which support shared libraries.
.IP "\fB\-Bstatic\fR" 4
.IX Item "-Bstatic"
.PD 0
@@ -801,7 +881,8 @@ Do not link against shared libraries. This is only meaningful on
platforms for which shared libraries are supported. The different
variants of this option are for compatibility with various systems. You
may use this option multiple times on the command line: it affects
-library searching for \fB\-l\fR options which follow it.
+library searching for \fB\-l\fR options which follow it. This
+option also implies \fB\-\-unresolved\-symbols=report\-all\fR.
.IP "\fB\-Bsymbolic\fR" 4
.IX Item "-Bsymbolic"
When creating a shared library, bind references to global symbols to the
@@ -934,9 +1015,11 @@ while linking a large executable.
.IP "\fB\-z defs\fR" 4
.IX Item "-z defs"
.PD
-Normally when creating a non-symbolic shared library, undefined symbols
-are allowed and left to be resolved by the runtime loader. These options
-disallows such undefined symbols.
+Report unresolved symbol references from regular object files. This
+is done even if the linker is creating a non-symbolic shared library.
+The switch \fB\-\-[no\-]allow\-shlib\-undefined\fR controls the
+behaviour for reporting unresolved references found in shared
+libraries being linked in.
.IP "\fB\-\-allow\-multiple\-definition\fR" 4
.IX Item "--allow-multiple-definition"
.PD 0
@@ -948,16 +1031,25 @@ report a fatal error. These options allow multiple definitions and the
first definition will be used.
.IP "\fB\-\-allow\-shlib\-undefined\fR" 4
.IX Item "--allow-shlib-undefined"
-Allow undefined symbols in shared objects even when \-\-no\-undefined is
-set. The net result will be that undefined symbols in regular objects
-will still trigger an error, but undefined symbols in shared objects
-will be ignored. The implementation of no_undefined makes the
-assumption that the runtime linker will choke on undefined symbols.
-However there is at least one system (BeOS) where undefined symbols in
-shared libraries is normal since the kernel patches them at load time to
-select which function is most appropriate for the current architecture.
-I.E. dynamically select an appropriate memset function. Apparently it
-is also normal for \s-1HPPA\s0 shared libraries to have undefined symbols.
+.PD 0
+.IP "\fB\-\-no\-allow\-shlib\-undefined\fR" 4
+.IX Item "--no-allow-shlib-undefined"
+.PD
+Allows (the default) or disallows undefined symbols in shared libraries.
+This switch is similar to \fB\-\-no\-undefined\fR except that it
+determines the behaviour when the undefined symbols are in a
+shared library rather than a regular object file. It does not affect
+how undefined symbols in regular object files are handled.
+.Sp
+The reason that \fB\-\-allow\-shlib\-undefined\fR is the default is that
+the shared library being specified at link time may not be the same as
+the one that is available at load time, so the symbols might actually be
+resolvable at load time. Plus there are some systems, (eg BeOS) where
+undefined symbols in shared libraries is normal. (The kernel patches
+them at load time to select which function is most appropriate
+for the current architecture. This is used for example to dynamically
+select an appropriate memset function). Apparently it is also normal
+for \s-1HPPA\s0 shared libraries to have undefined symbols.
.IP "\fB\-\-no\-undefined\-version\fR" 4
.IX Item "--no-undefined-version"
Normally when a symbol has an undefined version, the linker will ignore
@@ -1000,6 +1092,18 @@ name of a particular format supported by the \s-1BFD\s0 libraries. (You can
list the available binary formats with \fBobjdump \-i\fR.) The script
command \f(CW\*(C`OUTPUT_FORMAT\*(C'\fR can also specify the output format, but
this option overrides it.
+.IP "\fB\-pie\fR" 4
+.IX Item "-pie"
+.PD 0
+.IP "\fB\-\-pic\-executable\fR" 4
+.IX Item "--pic-executable"
+.PD
+Create a position independent executable. This is currently only supported on
+\&\s-1ELF\s0 platforms. Position independent executables are similar to shared
+libraries in that they are relocated by the dynamic linker to the virtual
+address the \s-1OS\s0 chooses for them (which can vary between invocations). Like
+normal dynamically linked executables they can be executed and symbols
+defined in the executable cannot be overridden by shared libraries.
.IP "\fB\-qmagic\fR" 4
.IX Item "-qmagic"
This option is ignored for Linux compatibility.
@@ -1186,11 +1290,40 @@ sign (``\fB=\fR''), and \fIorg\fR.
.IP "\fB\-Ttext\fR \fIorg\fR" 4
.IX Item "-Ttext org"
.PD
-Use \fIorg\fR as the starting address for\-\-\-respectively\-\-\-the
-\&\f(CW\*(C`bss\*(C'\fR, \f(CW\*(C`data\*(C'\fR, or the \f(CW\*(C`text\*(C'\fR segment of the output file.
-\&\fIorg\fR must be a single hexadecimal integer;
-for compatibility with other linkers, you may omit the leading
-\&\fB0x\fR usually associated with hexadecimal values.
+Same as \-\-section\-start, with \f(CW\*(C`.bss\*(C'\fR, \f(CW\*(C`.data\*(C'\fR or
+\&\f(CW\*(C`.text\*(C'\fR as the \fIsectionname\fR.
+.IP "\fB\-\-unresolved\-symbols=\fR\fImethod\fR" 4
+.IX Item "--unresolved-symbols=method"
+Determine how to handle unresolved symbols. There are four possible
+values for \fBmethod\fR:
+.RS 4
+.IP "\fBignore-all\fR" 4
+.IX Item "ignore-all"
+Do not report any unresolved symbols.
+.IP "\fBreport-all\fR" 4
+.IX Item "report-all"
+Report all unresolved symbols. This is the default.
+.IP "\fBignore-in-object-files\fR" 4
+.IX Item "ignore-in-object-files"
+Report unresolved symbols that are contained in shared libraries, but
+ignore them if they come from regular object files.
+.IP "\fBignore-in-shared-libs\fR" 4
+.IX Item "ignore-in-shared-libs"
+Report unresolved symbols that come from regular object files, but
+ignore them if they come from shared libraries. This can be useful
+when creating a dynamic binary and it is known that all the shared
+libraries that it should be referencing are included on the linker's
+command line.
+.RE
+.RS 4
+.Sp
+The behaviour for shared libraries on their own can also be controlled
+by the \fB\-\-[no\-]allow\-shlib\-undefined\fR option.
+.Sp
+Normally the linker will generate an error message for each reported
+unresolved symbol but the option \fB\-\-warn\-unresolved\-symbols\fR
+can change this to a warning.
+.RE
.IP "\fB\-\-dll\-verbose\fR" 4
.IX Item "--dll-verbose"
.PD 0
@@ -1204,15 +1337,15 @@ the linker script being used by the linker.
.IX Item "--version-script=version-scriptfile"
Specify the name of a version script to the linker. This is typically
used when creating shared libraries to specify additional information
-about the version heirarchy for the library being created. This option
+about the version hierarchy for the library being created. This option
is only meaningful on \s-1ELF\s0 platforms which support shared libraries.
.IP "\fB\-\-warn\-common\fR" 4
.IX Item "--warn-common"
Warn when a common symbol is combined with another common symbol or with
-a symbol definition. Unix linkers allow this somewhat sloppy practice,
+a symbol definition. Unix linkers allow this somewhat sloppy practise,
but linkers on some other operating systems do not. This option allows
you to find potential problems from combining global symbols.
-Unfortunately, some C libraries use this practice, so you may get some
+Unfortunately, some C libraries use this practise, so you may get some
warnings about symbols in the libraries as well as in your programs.
.Sp
There are three kinds of global symbols, illustrated here by C examples:
@@ -1319,6 +1452,15 @@ alignment. Typically, the alignment will be set by an input section.
The address will only be changed if it not explicitly specified; that
is, if the \f(CW\*(C`SECTIONS\*(C'\fR command does not specify a start address for
the section.
+.IP "\fB\-\-warn\-unresolved\-symbols\fR" 4
+.IX Item "--warn-unresolved-symbols"
+If the linker is going to report an unresolved symbol (see the option
+\&\fB\-\-unresolved\-symbols\fR) it will normally generate an error.
+This option makes it generate a warning instead.
+.IP "\fB\-\-error\-unresolved\-symbols\fR" 4
+.IX Item "--error-unresolved-symbols"
+This restores the linker's default behaviour of generating errors when
+it is reporting unresolved symbols.
.IP "\fB\-\-whole\-archive\fR" 4
.IX Item "--whole-archive"
For each archive mentioned on the command line after the
@@ -1349,9 +1491,9 @@ Here is a trivial example:
.Sp
.Vb 6
\& void *
-\& __wrap_malloc (int c)
+\& __wrap_malloc (size_t c)
\& {
-\& printf ("malloc called with %ld\en", c);
+\& printf ("malloc called with %zu\en", c);
\& return __real_malloc (c);
\& }
.Ve
@@ -1396,16 +1538,19 @@ values by either a space or an equals sign.
.IX Item "--add-stdcall-alias"
If given, symbols with a stdcall suffix (@\fInn\fR) will be exported
as-is and also with the suffix stripped.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-base\-file\fR \fIfile\fR" 4
.IX Item "--base-file file"
Use \fIfile\fR as the name of a file in which to save the base
addresses of all the relocations needed for generating DLLs with
\&\fIdlltool\fR.
+[This is an i386 \s-1PE\s0 specific option]
.IP "\fB\-\-dll\fR" 4
.IX Item "--dll"
Create a \s-1DLL\s0 instead of a regular executable. You may also use
\&\fB\-shared\fR or specify a \f(CW\*(C`LIBRARY\*(C'\fR in a given \f(CW\*(C`.def\*(C'\fR
file.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-enable\-stdcall\-fixup\fR" 4
.IX Item "--enable-stdcall-fixup"
.PD 0
@@ -1413,7 +1558,7 @@ file.
.IX Item "--disable-stdcall-fixup"
.PD
If the link finds a symbol that it cannot resolve, it will attempt to
-do \*(L"fuzzy linking\*(R" by looking for another defined symbol that differs
+do ``fuzzy linking'' by looking for another defined symbol that differs
only in the format of the symbol name (cdecl vs stdcall) and will
resolve that symbol by linking to the match. For example, the
undefined symbol \f(CW\*(C`_foo\*(C'\fR might be linked to the function
@@ -1425,6 +1570,7 @@ to be usable. If you specify \fB\-\-enable\-stdcall\-fixup\fR, this
feature is fully enabled and warnings are not printed. If you specify
\&\fB\-\-disable\-stdcall\-fixup\fR, this feature is disabled and such
mismatches are considered to be errors.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-export\-all\-symbols\fR" 4
.IX Item "--export-all-symbols"
If given, all global symbols in the objects used to build a \s-1DLL\s0 will
@@ -1449,10 +1595,12 @@ These cygwin-excludes are: \f(CW\*(C`_cygwin_dll_entry@12\*(C'\fR,
\&\f(CW\*(C`_fmode\*(C'\fR, \f(CW\*(C`_impure_ptr\*(C'\fR, \f(CW\*(C`cygwin_attach_dll\*(C'\fR,
\&\f(CW\*(C`cygwin_premain0\*(C'\fR, \f(CW\*(C`cygwin_premain1\*(C'\fR, \f(CW\*(C`cygwin_premain2\*(C'\fR,
\&\f(CW\*(C`cygwin_premain3\*(C'\fR, and \f(CW\*(C`environ\*(C'\fR.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-exclude\-symbols\fR \fIsymbol\fR\fB,\fR\fIsymbol\fR\fB,...\fR" 4
.IX Item "--exclude-symbols symbol,symbol,..."
Specifies a list of symbols which should not be automatically
exported. The symbol names may be delimited by commas or colons.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-exclude\-libs\fR \fIlib\fR\fB,\fR\fIlib\fR\fB,...\fR" 4
.IX Item "--exclude-libs lib,lib,..."
Specifies a list of archive libraries from which symbols should not be automatically
@@ -1460,11 +1608,13 @@ exported. The library names may be delimited by commas or colons. Specifying
\&\f(CW\*(C`\-\-exclude\-libs ALL\*(C'\fR excludes symbols in all archive libraries from
automatic export. Symbols explicitly listed in a .def file are still exported,
regardless of this option.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-file\-alignment\fR" 4
.IX Item "--file-alignment"
Specify the file alignment. Sections in the file will always begin at
file offsets which are multiples of this number. This defaults to
512.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-heap\fR \fIreserve\fR" 4
.IX Item "--heap reserve"
.PD 0
@@ -1474,6 +1624,7 @@ file offsets which are multiples of this number. This defaults to
Specify the amount of memory to reserve (and optionally commit) to be
used as heap for this program. The default is 1Mb reserved, 4K
committed.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-image\-base\fR \fIvalue\fR" 4
.IX Item "--image-base value"
Use \fIvalue\fR as the base address of your program or dll. This is
@@ -1482,28 +1633,36 @@ is loaded. To reduce the need to relocate and improve performance of
your dlls, each should have a unique base address and not overlap any
other dlls. The default is 0x400000 for executables, and 0x10000000
for dlls.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-kill\-at\fR" 4
.IX Item "--kill-at"
If given, the stdcall suffixes (@\fInn\fR) will be stripped from
symbols before they are exported.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-major\-image\-version\fR \fIvalue\fR" 4
.IX Item "--major-image-version value"
-Sets the major number of the \*(L"image version\*(R". Defaults to 1.
+Sets the major number of the ``image version''. Defaults to 1.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-major\-os\-version\fR \fIvalue\fR" 4
.IX Item "--major-os-version value"
-Sets the major number of the \*(L"os version\*(R". Defaults to 4.
+Sets the major number of the ``os version''. Defaults to 4.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-major\-subsystem\-version\fR \fIvalue\fR" 4
.IX Item "--major-subsystem-version value"
-Sets the major number of the \*(L"subsystem version\*(R". Defaults to 4.
+Sets the major number of the ``subsystem version''. Defaults to 4.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-minor\-image\-version\fR \fIvalue\fR" 4
.IX Item "--minor-image-version value"
-Sets the minor number of the \*(L"image version\*(R". Defaults to 0.
+Sets the minor number of the ``image version''. Defaults to 0.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-minor\-os\-version\fR \fIvalue\fR" 4
.IX Item "--minor-os-version value"
-Sets the minor number of the \*(L"os version\*(R". Defaults to 0.
+Sets the minor number of the ``os version''. Defaults to 0.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-minor\-subsystem\-version\fR \fIvalue\fR" 4
.IX Item "--minor-subsystem-version value"
-Sets the minor number of the \*(L"subsystem version\*(R". Defaults to 0.
+Sets the minor number of the ``subsystem version''. Defaults to 0.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-output\-def\fR \fIfile\fR" 4
.IX Item "--output-def file"
The linker will create the file \fIfile\fR which will contain a \s-1DEF\s0
@@ -1511,14 +1670,16 @@ file corresponding to the \s-1DLL\s0 the linker is generating. This \s-1DEF\s0
(which should be called \f(CW\*(C`*.def\*(C'\fR) may be used to create an import
library with \f(CW\*(C`dlltool\*(C'\fR or may be used as a reference to
automatically or implicitly exported symbols.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-out\-implib\fR \fIfile\fR" 4
.IX Item "--out-implib file"
The linker will create the file \fIfile\fR which will contain an
import lib corresponding to the \s-1DLL\s0 the linker is generating. This
import lib (which should be called \f(CW\*(C`*.dll.a\*(C'\fR or \f(CW\*(C`*.a\*(C'\fR
-may be used to link clients against the generated \s-1DLL\s0; this behavior
+may be used to link clients against the generated \s-1DLL\s0; this behaviour
makes it possible to skip a separate \f(CW\*(C`dlltool\*(C'\fR import library
creation step.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-enable\-auto\-image\-base\fR" 4
.IX Item "--enable-auto-image-base"
Automatically choose the image base for DLLs, unless one is specified
@@ -1526,25 +1687,33 @@ using the \f(CW\*(C`\-\-image\-base\*(C'\fR argument. By using a hash generated
from the dllname to create unique image bases for each \s-1DLL\s0, in-memory
collisions and relocations which can delay program execution are
avoided.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-disable\-auto\-image\-base\fR" 4
.IX Item "--disable-auto-image-base"
Do not automatically generate a unique image base. If there is no
user-specified image base (\f(CW\*(C`\-\-image\-base\*(C'\fR) then use the platform
default.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-dll\-search\-prefix\fR \fIstring\fR" 4
.IX Item "--dll-search-prefix string"
-When linking dynamically to a dll without an import library, i
+When linking dynamically to a dll without an import library,
search for \f(CW\*(C`<string><basename>.dll\*(C'\fR in preference to
-\&\f(CW\*(C`lib<basename>.dll\*(C'\fR. This behavior allows easy distinction
+\&\f(CW\*(C`lib<basename>.dll\*(C'\fR. This behaviour allows easy distinction
between DLLs built for the various \*(L"subplatforms\*(R": native, cygwin,
uwin, pw, etc. For instance, cygwin DLLs typically use
\&\f(CW\*(C`\-\-dll\-search\-prefix=cyg\*(C'\fR.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-enable\-auto\-import\fR" 4
.IX Item "--enable-auto-import"
Do sophisticated linking of \f(CW\*(C`_symbol\*(C'\fR to \f(CW\*(C`_\|_imp_\|_symbol\*(C'\fR for
\&\s-1DATA\s0 imports from DLLs, and create the necessary thunking symbols when
-building the DLLs with those \s-1DATA\s0 exports. This generally will 'just
-work' \*(-- but sometimes you may see this message:
+building the import libraries with those \s-1DATA\s0 exports. Note: Use of the
+\&'auto\-import' extension will cause the text section of the image file
+to be made writable. This does not conform to the PE-COFF format
+specification published by Microsoft.
+.Sp
+Using 'auto\-import' generally will 'just work' \*(-- but sometimes you may
+see this message:
.Sp
"variable '<var>' can't be auto\-imported. Please read the
documentation for ld's \f(CW\*(C`\-\-enable\-auto\-import\*(C'\fR for details."
@@ -1562,7 +1731,11 @@ the warning, and exit.
There are several ways to address this difficulty, regardless of the
data type of the exported variable:
.Sp
-One solution is to force one of the 'constants' to be a variable \*(--
+One way is to use \-\-enable\-runtime\-pseudo\-reloc switch. This leaves the task
+of adjusting references in your client code for runtime environment, so
+this method works only when runtime environment supports this feature.
+.Sp
+A second solution is to force one of the 'constants' to be a variable \*(--
that is, unknown and un-optimizable at compile time. For arrays,
there are two possibilities: a) make the indexee (the array's address)
a variable, or b) make the 'constant' index a variable. Thus:
@@ -1598,9 +1771,9 @@ or
\& { volatile long long * local_ll=&extern_ll; *local_ll }
.Ve
.Sp
-A second method of dealing with this difficulty is to abandon
+A third method of dealing with this difficulty is to abandon
\&'auto\-import' for the offending symbol and mark it with
-\&\f(CW\*(C`_\|_declspec(dllimport)\*(C'\fR. However, in practice that
+\&\f(CW\*(C`_\|_declspec(dllimport)\*(C'\fR. However, in practise that
requires using compile-time #defines to indicate whether you are
building a \s-1DLL\s0, building client code that will link to the \s-1DLL\s0, or
merely building/linking to a static library. In making the choice
@@ -1652,21 +1825,37 @@ Solution 2:
\& }
.Ve
.Sp
-A third way to avoid this problem is to re-code your
+A fourth way to avoid this problem is to re-code your
library to use a functional interface rather than a data interface
for the offending variables (e.g. \fIset_foo()\fR and \fIget_foo()\fR accessor
functions).
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-disable\-auto\-import\fR" 4
.IX Item "--disable-auto-import"
-Do not attempt to do sophisticalted linking of \f(CW\*(C`_symbol\*(C'\fR to
+Do not attempt to do sophisticated linking of \f(CW\*(C`_symbol\*(C'\fR to
\&\f(CW\*(C`_\|_imp_\|_symbol\*(C'\fR for \s-1DATA\s0 imports from DLLs.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-enable\-runtime\-pseudo\-reloc\fR" 4
+.IX Item "--enable-runtime-pseudo-reloc"
+If your code contains expressions described in \-\-enable\-auto\-import section,
+that is, \s-1DATA\s0 imports from \s-1DLL\s0 with non-zero offset, this switch will create
+a vector of 'runtime pseudo relocations' which can be used by runtime
+environment to adjust references to such data in your client code.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
+.IP "\fB\-\-disable\-runtime\-pseudo\-reloc\fR" 4
+.IX Item "--disable-runtime-pseudo-reloc"
+Do not create pseudo relocations for non-zero offset \s-1DATA\s0 imports from
+DLLs. This is the default.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-enable\-extra\-pe\-debug\fR" 4
.IX Item "--enable-extra-pe-debug"
Show additional debug info related to auto-import symbol thunking.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-section\-alignment\fR" 4
.IX Item "--section-alignment"
Sets the section alignment. Sections in memory will always begin at
addresses which are a multiple of this number. Defaults to 0x1000.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-stack\fR \fIreserve\fR" 4
.IX Item "--stack reserve"
.PD 0
@@ -1676,6 +1865,7 @@ addresses which are a multiple of this number. Defaults to 0x1000.
Specify the amount of memory to reserve (and optionally commit) to be
used as stack for this program. The default is 2Mb reserved, 4K
committed.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.IP "\fB\-\-subsystem\fR \fIwhich\fR" 4
.IX Item "--subsystem which"
.PD 0
@@ -1688,10 +1878,12 @@ Specifies the subsystem under which your program will execute. The
legal values for \fIwhich\fR are \f(CW\*(C`native\*(C'\fR, \f(CW\*(C`windows\*(C'\fR,
\&\f(CW\*(C`console\*(C'\fR, and \f(CW\*(C`posix\*(C'\fR. You may optionally set the
subsystem version also.
+[This option is specific to the i386 \s-1PE\s0 targeted port of the linker]
.SH "ENVIRONMENT"
.IX Header "ENVIRONMENT"
-You can change the behavior of \fBld\fR with the environment variables
-\&\f(CW\*(C`GNUTARGET\*(C'\fR, \f(CW\*(C`LDEMULATION\*(C'\fR, and \f(CW\*(C`COLLECT_NO_DEMANGLE\*(C'\fR.
+You can change the behaviour of \fBld\fR with the environment variables
+\&\f(CW\*(C`GNUTARGET\*(C'\fR,
+\&\f(CW\*(C`LDEMULATION\*(C'\fR and \f(CW\*(C`COLLECT_NO_DEMANGLE\*(C'\fR.
.PP
\&\f(CW\*(C`GNUTARGET\*(C'\fR determines the input-file object format if you don't
use \fB\-b\fR (or its synonym \fB\-\-format\fR). Its value should be one
@@ -1726,11 +1918,12 @@ the Info entries for \fIbinutils\fR and
\&\fIld\fR.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
-Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc.
+Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001,
+2002, 2003, 2004 Free Software Foundation, Inc.
.PP
Permission is granted to copy, distribute and/or modify this document
under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
-section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
+section entitled ``\s-1GNU\s0 Free Documentation License''.
OpenPOWER on IntegriCloud