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: Symbol refcounting for STT_GNU_IFUNC symbols


On Fri, Jul 2, 2010 at 7:47 AM, Stephen Clarke <stephen.clarke@st.com> wrote:
> In bfd/elf32-386.c, elf_i386_check_relocs(), for R_386_GOT32 and
> R_386_GOTOFF relocations with a symbol with STT_GNU_IFUNC type, the
> h->got.refcount is incremented:
>
> ? ? ? ? ? ? ? ?case R_386_GOT32:
> ? ? ? ? ? ? ? ?case R_386_GOTOFF:
> ? ? ? ? ? ? ? ? ?h->got.refcount += 1;
>
> I guess this is because the mechanism for IFUNC symbols requires a GOT
> entry (even for a GOTOFF relocation which does not normally require a
> GOT entry).
>
> However, there is no corresponding decrement in the
> elf_i386_gc_sweep_hook() if the relocation is removed.
> Is this just a minor (safe) inaccuracy, or is there some reason why the
> refcount cannot be decremented in elf_i386_gc_sweep_hook()?
>

It could be an oversight.  Do you have an testcase?

Thanks.

-- 
H.J.


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