This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: .got increase in -gc-sections for MIPS
- From: Hiroki Kaminaga <kaminaga at sm dot sony dot co dot jp>
- To: ths at networkno dot de
- Cc: ddaney at avtrex dot com, binutils at sourceware dot org, kaminaga at sm dot sony dot co dot jp
- Date: Mon, 04 Dec 2006 14:42:42 +0900 (JST)
- Subject: Re: .got increase in -gc-sections for MIPS
- References: <20061130.181110.115902247.kaminaga@sm.sony.co.jp> <456F0795.7020206@avtrex.com> <20061130164256.GC12258@networkno.de>
Thiemo Seufer wrote:
> Current HEAD incrases for Hiroki's testcase by four GOT entries when using
> --gc-sections. It's not surprising it doesn't shrink, given that we don't
> do reference counting for GOT entries, but I don't see ATM where the
> increase comes from.
I tracked down with gdb, and found that, for every functions to be removed
by -gc-sections, local got got bumped up.
backtrace:
elf_gc_sweep_symbol() -> _bfd_mips_elf_hide_symbol()
and goes to
9672 else if (g->global_gotno == 0 && g->global_gotsym == NULL)
9673 /* If we haven't got through GOT allocation yet, just bump up the
9674 number of local entries, as this symbol won't be counted as
9675 global. */
9676 g->local_gotno++;
and increments MIPS_LOCAL_GOTNO.
I assume _bfd_mips_elf_hide_symbol() is for Visibility HIDDEN.
Is this bump up of local_gotno necessary for -gc-sections?
Thanks in Advance.
(Hiroki Kaminaga)
t
--