This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Use only needed weak prototypes
- To: Richard Henderson <rth at redhat dot com>
- Subject: Re: [PATCH] Use only needed weak prototypes
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 29 Oct 2001 08:58:22 -0500
- Cc: gcc-patches at gcc dot gnu dot org, binutils at sources dot redhat dot com
- References: <20011026110103.A926@sunsite.ms.mff.cuni.cz> <20011026095517.B1663@redhat.com>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
On Fri, Oct 26, 2001 at 09:55:17AM -0700, Richard Henderson wrote:
> On Fri, Oct 26, 2001 at 11:01:03AM +0200, Jakub Jelinek wrote:
> > Every weak prototype, even if it is not used at all, adds an entry to
> > .dynsym and symbol name to .dynstr...
>
> Seems like this is something that ought to get fixed in
> the assembler. We shouldn't add the symbol to the table
> unless it is used elsewhere.
I've just checked Sun as and it works the same way (ie.
.weak foo
.weak bar
.word foo
will result in WEAK UNDEF foo and bar symbols).
On the other side, linker if it finds both WEAK and non-WEAK UNDEF symbol of
the same name merges them into non-WEAK UNDEF, so changing it in as should
not cause problems.
Jakub