[PATCH] D26029: [LLD][ARM] ARM IRELATIVE relocations are in rel.dyn

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 1 06:17:27 PDT 2016


peter.smith added a comment.

To the best of my knowledge from grepping through the code, I'm no glibc expert unfortunately, I think a good place to start from is do-rel.h in the elf sub-directory of glibc:
https://fossies.org/dox/glibc-2.24/do-rel_8h_source.html
This has elf_dynamic_do_Rel which is the code that iterates over the Relocations in .rel.plt or .rel.dyn.

Another useful file is dynamic-link.h also in the elf sub-directory https://fossies.org/dox/glibc-2.24/dynamic-link_8h_source.html
This contains the _ELF_DYNAMIC_DO_RELOC which gets the range information for .rel.plt and .rel.dyn from the .dynamic segment/section tags such as DT_REL and DT_JMPREL. The appropriate REL or RELA version of elf_dynamic_do_Rel is called from here with the relocation information from either .rel.plt or .rel.dyn (Line 160).

The definition of elf_machine_lazy_rel (PLT) or elf_machine_rel (GOT) are in sysdeps/<TARGET>/dl-machine.h

At this stage elf_machine_lazy_rel won't do the relocation for relocations such as R_*_JUMP_SLOT, but will instead set up the .got.plt to point to the resolver. Interestingly for R_*_IRELATIVE the ifunc resolver is called so there is no lazy evaluation of the resolution.

Hope this is of some use.


https://reviews.llvm.org/D26029





More information about the llvm-commits mailing list