[PATCH] D61613: [LLD][ELF] Add the -z ifunc-noplt option

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 7 20:28:38 PDT 2019


MaskRay added a comment.

There is another issue: this feature is arch-specific and probably only applies on x86:

  // ELF/Relocations.cpp#L880
      } else if (RelType Rel = Target->getDynRel(Type)) {
        In.RelaDyn->addReloc(Rel, &Sec, Offset, &Sym, Addend, R_ADDEND, Type);

On non-x86, you probably can't find an appropriate dynamic relocation type that resolves your desired text relocations. This looks to me a really hacky feature (linker support + textrel special case + more dynamic relocation type handling) that is limited to x86. Its benefit is also unclear (I can't find benchmarks in several of your FreeBSD patches). On the other hand, the alternative (a global function pointer) seems equally good.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61613/new/

https://reviews.llvm.org/D61613





More information about the llvm-commits mailing list