This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Patch: Fix elf_find_function () on a corner case
- From: Jie Zhang <jzhang918 at gmail dot com>
- To: Jan Beulich <JBeulich at novell dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 23 Nov 2005 01:15:16 +0800
- Subject: Re: Patch: Fix elf_find_function () on a corner case
- References: <438349D5.5090400@gmail.com> <43835AD1.76F0.0078.0@novell.com>
On 11/23/05, Jan Beulich <JBeulich@novell.com> wrote:
> >ld: warning: cannot find entry symbol _start; defaulting to 08048094
> >t.o: In function `aaa':b.c:(.text+0x7): undefined reference to `bar'
> >t.o: In function `bbb':b.c:(.text+0x17): undefined reference to `bar'
>
> I wouldn't want to loose the information on the source file, if that
> information is available. This makes finding the function easier, and in
> case of local functions or multiply defined (weak) ones disambiguates
> their origin.
>
In this case, the best information we want is:
t.o: In function `aaa':a.c:(.text+0x7): undefined reference to `bar'
t.o: In function `bbb':b.c:(.text+0x17): undefined reference to `bar'
However, ld cannot give out such information since t.o was got by 'ld
-r' from a.o and b.o. There are two FILE symbols in t.o. For global
symbols like aaa and bbb, elf_find_function () cannot find their
files. The best thing it can do is not output misleading (wrong)
source file information.
> >While we expect it to output:
> >
> >ld: warning: cannot find entry symbol _start; defaulting to 08048094
> >t.o: In function `aaa': undefined reference to `bar'
> >t.o: In function `bbb': undefined reference to `bar'
>
Jie