This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [mjt@tls.msk.ru: ltrace can't trace binaries linked with ld-2.15]
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Simon Richter <Simon dot Richter at hogyros dot de>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 11 Oct 2004 20:30:59 +0930
- Subject: Re: [mjt@tls.msk.ru: ltrace can't trace binaries linked with ld-2.15]
- References: <20041011094449.GA628@hogyros.de>
On Mon, Oct 11, 2004 at 11:44:49AM +0200, Simon Richter wrote:
> Hi,
>
> Debian received the message below through the bug tracking system. Could
> somebody give me an executive summary on what has changed in the linker
> that would cause the output described below, so we get an idea on where
> to go with this bug?
It's a deliberate change in ld behaviour, to speed ld.so. Search for
ELF_LINK_POINTER_EQUALITY_NEEDED on the binutils list.
> ----- Forwarded message from Michael Tokarev <mjt@tls.msk.ru> -----
>
> Date: Tue, 05 Oct 2004 03:07:48 +0400
> From: Michael Tokarev <mjt@tls.msk.ru>
> To: Debian Bug Tracking System <submit@bugs.debian.org>
> Subject: ltrace can't trace binaries linked with ld-2.15
>
> Package: ltrace,binutils
> Severity: grave
> Justification: renders ltrace package unusable
>
> I'm not really sure for which package this bug/problem
> belongs, so filing against both.
>
> After upgrading binutils to 2.15, I noticied ltrace stopped
> working on binaries compiled/linked after upgrade. Ltrace
> produces one line of output -- the finall exit line only:
>
> $ ltrace ./a.out
> +++ exited (status 0) +++
>
> for every such binary.
>
> After some digging, I found the difference between binaries
> *linked* (the problem is with ld only, the final link stage)
> in .dynsym section. For example (objdump -T output):
>
> executable produced by ld-2.15:
>
> bad: file format elf32-i386
>
> DYNAMIC SYMBOL TABLE:
> 00000000 DF *UND* 0000007c GLIBC_2.0 write
> 00000000 DF *UND* 0000003f GLIBC_2.0 strcmp
> 00000000 DF *UND* 00000071 GLIBC_2.0 close
> ....
>
> executable produced by pre-2.15 ld:
>
> good: file format elf32-i386
>
> DYNAMIC SYMBOL TABLE:
> 0804859c DF *UND* 0000007c GLIBC_2.0 write
> 080485ac DF *UND* 0000003f GLIBC_2.0 strcmp
> 080485bc DF *UND* 00000071 GLIBC_2.0 close
> ....
>
>
> That is, ld-2.15 fills first column with zeros, while
> ld-pre-2.15 places some non-zero numbers here.
>
> I don't know ELF format, and don't even know what this
> first column in objdump output means.
>
> -- System Information
> Debian Release: 3.0
> Architecture: i386
> Kernel: Linux paltus.tls.msk.ru 2.6.7-i686-2 #1 Mon Jul 26 18:54:34 MSD 2004
> i686 GNU/Linux
> Locale: LANG=ru_RU.KOI8-R
>
> Relevant packages:
>
> ii binutils 2.15-4 The GNU assembler, linker and binary
> utiliti
> ii ltrace 0.3.35 Tracks runtime library calls in dynamically
> ii gcc-3.3 3.3.4-6sarge1. The GNU C compiler
>
>
>
> ----- End forwarded message -----
>
> --
> GPG Fingerprint: 040E B5F7 84F1 4FBC CEAD ADC6 18A0 CC8D 5706 A4B4
--
Alan Modra
IBM OzLabs - Linux Technology Centre