This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Symbol refcounting for STT_GNU_IFUNC symbols
- From: Stephen Clarke <stephen dot clarke at st dot com>
- To: <binutils at sourceware dot org>
- Date: Fri, 2 Jul 2010 15:47:08 +0100
- Subject: Symbol refcounting for STT_GNU_IFUNC symbols
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()?
Steve.