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: Benjamin Kosnik <bkoz at redhat dot com>
- Date: Thu, 24 Aug 2000 18:15:12 -0700 (PDT)
- cc: bug-glibc at gnu dot org, alan at linuxcare dot com dot au, binutils at sources dot redhat dot com
We had a similar bug with .eh_frame when --gc-sections was turned on for
libstdc++-v3 (June 16ish, 2000):
http://sources.redhat.com/ml/libstdc++/2000-06/msg00128.html
Here's the commentary on the binutils list:
http://sources.redhat.com/ml/binutils/2000-06/msg00351.html
Alan, I've cc'd you on this because you quickly fixed the previous
problem. Can you please look at this, too? It looks like the exact same
deal, ie something like this needs to be added to the linker script:
.__libc_subinit : { KEEP (*(.__libc_subinit)) }
thanks,
benjamin
On 24 Aug 2000, Ulrich Drepper wrote:
> Benjamin Kosnik <bkoz@redhat.com> writes:
>
> > Can you please look at this?
>
> The problem is that the linker is simply throwing away code in the
> __libc_subinit section. This code is of course not referenced anyware
> but is still used similar to constructors.
>
> I don't know how to teach ld about this. Best is to never link
> statically with glibc if you use --gc-sections.