This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: --gc-sections and C library linkage issues (?)
- To: Ulrich Drepper <drepper at cygnus dot com>
- Subject: Re: --gc-sections and C library linkage issues (?)
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Fri, 25 Aug 2000 12:09:29 +1000 (EST)
- cc: Benjamin Kosnik <bkoz at redhat dot com>, bug-glibc at gnu dot org, binutils at sources dot redhat dot com
On 24 Aug 2000, Ulrich Drepper wrote:
> Benjamin Kosnik <bkoz@redhat.com> writes:
>
> > deal, ie something like this needs to be added to the linker script:
> >
> > .__libc_subinit : { KEEP (*(.__libc_subinit)) }
>
> We have several different sections like this. You are fixing a
> symptom. IMO --gc-sections should not be used until it can be
> properly implemented.
--gc-sections discards a section which isn't referenced via any of
it's symbols. That seems quite a proper implementation. The problem
really is that glibc doesn't make such a symbol reference. You should be
able to do this with a reference to the section symbol from any section
that you know will escape garbage collection.
Hmm, I suppose it would be nice if you could tell the assembler to keep
a section via a section attribute. If you would like to suggest
semantics, I'll implement it.
Alan Modra
--
Linuxcare. Support for the Revolution.