summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/ld
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2002-12-02 09:39:02 +0000
committerobrien <obrien@FreeBSD.org>2002-12-02 09:39:02 +0000
commitb0507dc8c419be586c4d83efe2e02bbeb2adbce8 (patch)
tree8924adb5a18aba536a65e549b162368c1f5aef5a /contrib/binutils/ld
parentc9b52f01365db6f2d42c4191addadeabf1e1791f (diff)
downloadFreeBSD-src-b0507dc8c419be586c4d83efe2e02bbeb2adbce8.zip
FreeBSD-src-b0507dc8c419be586c4d83efe2e02bbeb2adbce8.tar.gz
Update HEAD with the stock files.
Diffstat (limited to 'contrib/binutils/ld')
-rw-r--r--contrib/binutils/ld/configure.host2
-rw-r--r--contrib/binutils/ld/configure.tgt12
-rw-r--r--contrib/binutils/ld/ld.123
3 files changed, 29 insertions, 8 deletions
diff --git a/contrib/binutils/ld/configure.host b/contrib/binutils/ld/configure.host
index 56ed187..436a912 100644
--- a/contrib/binutils/ld/configure.host
+++ b/contrib/binutils/ld/configure.host
@@ -25,7 +25,7 @@ case "${host}" in
# 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-file-name=ld-elf.so.1`" > specs
+ 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`'
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`'
;;
diff --git a/contrib/binutils/ld/configure.tgt b/contrib/binutils/ld/configure.tgt
index c1d7620..bcdbb04 100644
--- a/contrib/binutils/ld/configure.tgt
+++ b/contrib/binutils/ld/configure.tgt
@@ -491,8 +491,16 @@ fr30-*-*) targ_emul=elf32fr30 ;;
mcore-*-pe) targ_emul=mcorepe ;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
mcore-*-elf) targ_emul=elf32mcore ;;
-s390x-*-linux*) targ_emul=elf64_s390 ;;
-s390-*-linux*) targ_emul=elf_s390 ;;
+s390x-*-linux*) targ_emul=elf64_s390
+ targ_extra_emuls=elf_s390
+ targ_extra_libpath=$targ_extra_emuls
+ tdir_elf_s390=`echo ${targ_alias} | sed -e 's/s390x/s390/'` ;;
+s390-*-linux*) targ_emul=elf_s390
+ if test "${want64}" = "true"; then
+ targ_extra_emuls=elf64_s390
+ targ_extra_libpath=$targ_extra_emuls
+ tdir_elf64_s390=`echo ${targ_alias} | sed -e 's/s390/s390x/'`
+ fi ;;
*-*-ieee*) targ_emul=vanilla ;;
*)
diff --git a/contrib/binutils/ld/ld.1 b/contrib/binutils/ld/ld.1
index 79d5d65..9d7a53e 100644
--- a/contrib/binutils/ld/ld.1
+++ b/contrib/binutils/ld/ld.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13
+.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -21,7 +21,6 @@
..
.de Ve \" End verbatim text
.ft R
-
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
@@ -129,10 +128,9 @@
.\" ========================================================================
.\"
.IX Title "LD 1"
-.TH LD 1 "2002-08-05" "binutils-2.12.91" "GNU Development Tools"
-.UC
+.TH LD 1 "2002-10-30" "binutils-2.13" "GNU Development Tools"
.SH "NAME"
-ld \- Using \s-1LD\s0, the \s-1GNU\s0 linker
+ld \- Using LD, the GNU linker
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
ld [\fBoptions\fR] \fIobjfile\fR ...
@@ -177,6 +175,7 @@ link a file \f(CW\*(C`hello.o\*(C'\fR:
.Vb 1
\& ld -o <output> /lib/crt0.o hello.o -lc
.Ve
+.PP
This tells \fBld\fR to produce a file called \fIoutput\fR as the
result of linking the file \f(CW\*(C`/lib/crt0.o\*(C'\fR with \f(CW\*(C`hello.o\*(C'\fR and
the library \f(CW\*(C`libc.a\*(C'\fR, which will come from the standard search
@@ -242,6 +241,7 @@ compiler driver) like this:
.Vb 1
\& gcc -Wl,--startgroup foo.o bar.o -Wl,--endgroup
.Ve
+.PP
This is important, because otherwise the compiler driver program may
silently drop the linker options, resulting in a bad link.
.PP
@@ -958,6 +958,11 @@ 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.
+.IP "\fB\-\-no\-undefined\-version\fR" 4
+.IX Item "--no-undefined-version"
+Normally when a symbol has an undefined version, the linker will ignore
+it. This option disallows symbols with undefined version and a fatal error
+will be issued instead.
.IP "\fB\-\-no\-warn\-mismatch\fR" 4
.IX Item "--no-warn-mismatch"
Normally \fBld\fR will give an error if you try to link together input
@@ -1350,6 +1355,7 @@ Here is a trivial example:
\& return __real_malloc (c);
\& }
.Ve
+.Sp
If you link other code with this file using \fB\-\-wrap malloc\fR, then
all calls to \f(CW\*(C`malloc\*(C'\fR will call the function \f(CW\*(C`_\|_wrap_malloc\*(C'\fR
instead. The call to \f(CW\*(C`_\|_real_malloc\*(C'\fR in \f(CW\*(C`_\|_wrap_malloc\*(C'\fR will
@@ -1566,6 +1572,7 @@ a variable, or b) make the 'constant' index a variable. Thus:
\& extern_array[1] -->
\& { volatile type *t=extern_array; t[1] }
.Ve
+.Sp
or
.Sp
.Vb 3
@@ -1573,6 +1580,7 @@ or
\& extern_array[1] -->
\& { volatile int t=1; extern_array[t] }
.Ve
+.Sp
For structs (and most other multiword data types) the only option
is to make the struct itself (or the long long, or the ...) variable:
.Sp
@@ -1581,6 +1589,7 @@ is to make the struct itself (or the long long, or the ...) variable:
\& extern_struct.field -->
\& { volatile struct s *t=&extern_struct; t->field }
.Ve
+.Sp
or
.Sp
.Vb 3
@@ -1588,6 +1597,7 @@ or
\& extern_ll -->
\& { volatile long long * local_ll=&extern_ll; *local_ll }
.Ve
+.Sp
A second 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
@@ -1608,6 +1618,7 @@ Original:
\& printf("%d\en",arr[1]);
\& }
.Ve
+.Sp
Solution 1:
.Sp
.Vb 9
@@ -1621,6 +1632,7 @@ Solution 1:
\& printf("%d\en",parr[1]);
\& }
.Ve
+.Sp
Solution 2:
.Sp
.Vb 14
@@ -1639,6 +1651,7 @@ Solution 2:
\& printf("%d\en",arr[1]);
\& }
.Ve
+.Sp
A third 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
OpenPOWER on IntegriCloud