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]

MIPS local symbol GOT reservation w/o a reference relocation


Hello bfd experts,

I need to reserve and then create a local got entry for IFUNC symbols even when there are no reference relocations for it. This is the case when the dso being created has just the IFUNC definitions.

When there is a relocation, currently a local got is reserved in calculate_relocations() using the input bfd and the symbol index located in the relocation structure. Every thing works fine in this case.

Using mips_elf_link_hash_traverse() for the input bfd seemed to be  a reasonable way to find the ifunc symbols and reserve the got entry, but I cannot seem to extract the local symbol index for the ifunc symbol.

Is there a way to get the symbol index when processing just the symbols themselves. I thought that maybe elf_link_hash_entry *h->indx for the input object would be set to it, but it is just -1.

foreach ifunc function
    Create an iplt stub pointing to the got entry for the ifunc routine
    Put the original address for the ifunc routine into the got entry
    Create an R_MIPS_IRELATIVE relocation pointing to the got entry
    Create a dynsym entry for the ifunc routine, but point to the iplt stub instead

Thanks,

Jack


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