Question about one offst check in x86-64 bfd code
Jiong Wang
jiong.wang@arm.com
Thu May 7 09:52:00 GMT 2015
Hi HJ,
I see you added the initial IFUNC support for x86-64, I have one
question about the following code:
at the function "elf_x86_64_relocate_section:"
inside IFUNC handling code:
/* Since STT_GNU_IFUNC symbol must go through PLT, we handle
it here if it is defined in a non-shared object. */
if (h != NULL
&& h->type == STT_GNU_IFUNC
&& h->def_regular)
{
...
...
case R_X86_64_GOTPCREL:
case R_X86_64_GOTPCREL64:
base_got = htab->elf.sgot;
off = h->got.offset;
if (base_got == NULL)
abort ();
if (off == (bfd_vma) -1)
{
/* We can't use h->got.offset here to save state, or
even just remember the offset, as finish_dynamic_symbol
would use that as offset into .got. */
if (htab->elf.splt != NULL)
...
...
I am not quite understanding what's the meaning of "off == (bfd_vma)
-1", in what situation can "off" be -1? I am just wondering the global
symbol should always be recorded and thus with a positive offset, at
least on AArch64.
Thanks.
--
Regards,
Jiong
More information about the Binutils
mailing list