This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Linker Bug or Design Intent (Absolute symbols in zero sized sections)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: Paul Brook <paul at codesourcery dot com>, binutils at sourceware dot org, Alan Modra <amodra at bigpond dot net dot au>, Paul Koning <pkoning at equallogic dot com>, vgoyal at redhat dot com, drow at false dot org, binutils at sources dot redhat dot com
- Date: Tue, 10 Oct 2006 18:34:23 +0200
- Subject: Re: Linker Bug or Design Intent (Absolute symbols in zero sized sections)
- References: <4519350D.2090208@redhat.com> <17689.23227.571136.559871@gargle.gargle.HOWL> <20060926232851.GB1534@bubble.grove.modra.org> <200609281742.31472.paul@codesourcery.com> <20060928165251.GA20383@lucon.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Sep 28, 2006 at 09:52:51AM -0700, H. J. Lu wrote:
> On Thu, Sep 28, 2006 at 05:42:29PM +0100, Paul Brook wrote:
> > On Wednesday 27 September 2006 00:28, Alan Modra wrote:
> > > On Tue, Sep 26, 2006 at 12:52:11PM -0400, Paul Koning wrote:
> > > > >>>>> "H" == H J Lu <hjl@lucon.org> writes:
> > > >
> > > > H> Convert section relative symbol to absolute shouldn't be a problem
> > > > H> in most cases. If we know it may be a problem at link time, we can
> > > > H> keep it section relative.
> > > >
> > > > But what benefit is there in converting symbols from relative to
> > > > absolute? It seems more logical to leave them alone, always.
> > >
> > > We are talking about the case where the section defining the symbol
> > > is removed from the output.
> >
> > If we remove the section shouldn't we also remove the symbol?
>
> I have checked in a patch not to remove an empty section if there is
> a symbol relative to it.
This has an ugly drawback that now almost every executable has
[15] .preinit_array PREINIT_ARRAY 0000000010010a94 010a94 000000 00 WA 0 0 1
[16] .init_array INIT_ARRAY 0000000010010a94 010a94 000000 00 WA 0 0 1
[17] .fini_array FINI_ARRAY 0000000010010a94 010a94 000000 00 WA 0 0 1
Can't we at least come up with PROVIDES/PROVIDES_HIDDEN variants that would
allow these symbols turned into absolute and/or to absolute 0 if the
section is empty and not output such empty sections and use that in the
builtin linker script?
It is nice kernel can now do its dirty hacks, but the userland shouldn't
suffer because of that.
Jakub