This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[qboosh@pld.org.pl: Linker problems in binutils 2.13.90.0.x on alpha-linux]


Any ideas?


H.J.
----- Forwarded message from Jakub Bogusz <qboosh@pld.org.pl> -----

Delivered-To: hjl@localhost.lucon.org
Date: Thu, 7 Nov 2002 15:28:35 +0100
From: Jakub Bogusz <qboosh@pld.org.pl>
To: hjl@lucon.org
Subject: Linker problems in binutils 2.13.90.0.x on alpha-linux
User-Agent: Mutt/1.4i

Hello,

I noticed some serious problems with linker on alpha-linux after upgrade
to binutils 2.13.90.0.x (2.13.90.0.4 and 2.13.90.0.10 - one problem in
both versions, another (even more important I think) problem only in
the second version).

First I installed 2.13.90.0.4 - they generally worked except stripping
during linking (-s linker flag):

$ gcc blah.c -s
/usr/lib/gcc-lib/alpha-pld-linux/3.2.1/../../../crti.o: In function `_init':
/usr/lib/gcc-lib/alpha-pld-linux/3.2.1/../../../crti.o(.init+0x0): undefined reference to `local symbols in discarded section .debug_line'
/usr/lib/gcc-lib/alpha-pld-linux/3.2.1/../../../crti.o: In function `_fini':
/usr/lib/gcc-lib/alpha-pld-linux/3.2.1/../../../crti.o(.fini+0x0): undefined reference to `local symbols in discarded section .debug_line'
/usr/lib/libc_nonshared.a(atexit.oS): In function `atexit':
atexit.oS(.text+0x0): undefined reference to `local symbols in discarded section .debug_line'
atexit.oS(.text+0x2c): undefined reference to `local symbols in discarded section .debug_line'
collect2: ld returned 1 exit status

blah.c is simple program:

$ cat blah.c
int main() { }

Then I tried binutils 2.13.90.0.10 - messages changed a little, but
effect remained the same:

$ gcc blah.c -s
/usr/lib/gcc-lib/alpha-pld-linux/3.2.1/../../../crti.o(.init+0x0): In function `_init':
: undefined reference to `local symbols in discarded section .debug_line'
/usr/lib/gcc-lib/alpha-pld-linux/3.2.1/../../../crti.o(.fini+0x0): In function `_fini':
: undefined reference to `local symbols in discarded section .debug_line'
/usr/lib/libc_nonshared.a(atexit.oS)(.text+0x0): In function `atexit':
: undefined reference to `local symbols in discarded section .debug_line'
/usr/lib/libc_nonshared.a(atexit.oS)(.text+0x2c): In function `atexit':
: undefined reference to `local symbols in discarded section .debug_line'
collect2: ld returned 1 exit status

When I tried to build new glibc, process failed on stripping shared
libraries and modules - e.g.:

$ file  /tmp/glibc-2.3.1-root-builder/usr/lib/gconv/ANSI_X3.110.so
/tmp/glibc-2.3.1-root-builder/usr/lib/gconv/ANSI_X3.110.so: ELF 64-bit LSB shared object, Alpha (unofficial), version 1 (SYSV),
not stripped

$ strip  /tmp/glibc-2.3.1-root-builder/usr/lib/gconv/ANSI_X3.110.so
strip: /tmp/glibc-2.3.1-root-builder/usr/lib/gconv/stdEMYp3: File truncated

$ strace strip  /tmp/glibc-2.3.1-root-builder/usr/lib/gconv/ANSI_X3.110.so
[...]
lseek(4, 2, SEEK_CUR)                   = 18064
lseek(3, 24576, SEEK_SET)               = 24576
write(4, "\0GCC: (GNU) 3.2.1 20021022 (prer"..., 200) = 200
lseek(4, 18446744073709543424, SEEK_SET) = -1 EINVAL (Invalid argument)
         ^^^^^^^^^^^^^^^^^^^^
write(2, "strip: /tmp/glibc-2.3.1-root-bui"..., 76strip: /tmp/glibc-2.3.1-root-builder/usr/lib/gconv/stYHqrFb: File truncated
) = 76

(strip --strip-unneeded and strip --strip-debug gives the same result;
but there is no problem to strip executables)

It's problem with linker, not strip (I tried also strip from binutils
2.13.90.0.4 and 2.11.90.0.19 on those binaries). After downgrade to
binutils 2.13.90.0.4 glibc 2.3.1 was built successfully (but linked
without -s flag).

It happens only when using crt* etc. files from glibc 2.3.1, not 2.2.5
(which is installed) - e.g.:

$ gcc blah.c -shared -o libblah.so
$ strip libblah.so
$ gcc blah.c -shared -o libblah.so -B/home/users/builder/rpm/BUILD/glibc-2.3.1/builddir/csu/
$ strip libblah.so
strip: stnemUqI: File truncated


-- 
Jakub Bogusz
PLD Linux      http://www.pld.org.pl/

----- End forwarded message -----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]