[PATCH] D73474: [LLD][ELF][ARM] Do not insert interworking thunks for non STT_FUNC symbols

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 10:30:06 PST 2020


peter.smith marked 3 inline comments as done.
peter.smith added inline comments.


================
Comment at: lld/ELF/Arch/ARM.cpp:281
+    // Otherwise we need to interwork if STT_FUNC Symbol has bit 0 set (Thumb).
+    if (s.isFunc() && expr == R_PC && ((s.getVA() & 1) == 1))
       return true;
----------------
MaskRay wrote:
> `== 1` can be deleted. Can `s` be STT_GNU_IFUNC (`isGnuIFunc()`)?
I'll remove the 1, ifunc calls always have expr R_PLT_PC.


================
Comment at: lld/ELF/Arch/ARM.cpp:292
+    // Otherwise we need to interwork if STT_FUNC Symbol has bit 0 clear (ARM).
+    if (expr == R_PLT_PC || (s.isFunc() && (s.getVA() & 1) == 0))
       return true;
----------------
MaskRay wrote:
> Can `s` be STT_GNU_IFUNC?
Ifuncs are always called via the PLT so they use R_PLT_PC. I'll add a test to show this.


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

https://reviews.llvm.org/D73474





More information about the llvm-commits mailing list