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 13:40:56 +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:
> Alan Modra <alan@linuxcare.com.au> writes:
>
> > You should be able to do this with a reference to the section symbol
> > from any section that you know will escape garbage collection.
>
> No, this is not how it's supposed to work. Different .o files
> constribute to special sections but only if the functions in those .o
> files are used.
Oh yeah, that's right, garbage collection is on an input section basis, so
my idea of referencing the section symbol is completely bogus.
That leaves us with either
a) deciding on a set of specially named sections that will have the
KEEP attribute set, modifying the linker script to suit, and
ensuring glibc uses these sections.
or b) defining a new section attribute that sets SEC_KEEP.
or c) something else I haven't thought of.
I don't particularly like a). Adding support in gas/config/obj-elf.c for
a "k" section attribute letter and corresponding "keep" section attribute
word is trivial. The only tricky thing to decide is whether such an
attribute needs to appear in the elf section flags (ie. needs a new SHF_
flag), or should just affect the BFD section flags. I'm inclined to think
there is no need for a new SHF_ flag.
Comments?
Alan Modra
--
Linuxcare. Support for the Revolution.