This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: behavior of "strip -N"
- From: Ian Lance Taylor <ian at airs dot com>
- To: Adam Megacz <adam at megacz dot com>
- Cc: binutils at sources dot redhat dot com
- Date: 29 Jan 2002 21:42:23 -0800
- Subject: Re: behavior of "strip -N"
- References: <86sn8pt4xk.fsf@megacz.com>
Adam Megacz <adam@megacz.com> writes:
> I've noticed that when I strip a global symbol using strip -N and then
> link with --noinhibit-exec, the locations where that symbol's address
> would have been written get a 0x0 instead.
>
> However, when I strip a file-local symbol, those locations seem to get
> written with the address of the start of the section they fall in.
>
> Is there any way to get the first behavior (0x0) when stripping
> file-local symbols?
What happens when you do this is processor and object file format
dependent. The fact that you get a zero in some cases is a
coincidence. The fact that you get the address of the start of the
section in other cases is also a coincidence.
To make this reliable, you would need to track down many many cases in
the linker code which currently report an undefined symbol, and change
them to relocate using a value of zero rather than not bothering to do
any relocation at all.
Ian