[PATCH] D81184: [WIP][ELF][AArch64] Implement the logic for handling R_AARCH64_PLT32

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 4 13:51:06 PDT 2020


MaskRay added a comment.

I'm not sure unconditionally changing `.word foo - .` to use R_AARCH64_PLT32 is the appropriate change. Note that x86 `R_X86_64_PC32` doesn't do this.
`.word foo at plt - .` would probably make more sense. For one reason, R_AARCH64_PLT32 is not supported by binutils, unconditionally using it can break -fno-integrated-as.
There is also no need to special case on visiblity: `(ElfSym.getVisibility() == llvm::ELF::STV_HIDDEN) ? R_CLS(PREL32) : R_CLS(PLT32);`, you can entirely defer the handling to the linker

Additionally, the lld changes should probably be moved to a separate patch. It is not tightly coupled with MC. The tests are also inadequate - you'd need a range extension thunk test. I can do this part if you don't mind.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81184





More information about the llvm-commits mailing list