This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: .got increase in -gc-sections for MIPS


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
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]