[PATCH] D15779: [ELF] - Implemented optimization for R_X86_64_GOTPCREL relocation.
Rafael Ávila de Espíndola via llvm-commits
llvm-commits at lists.llvm.org
Wed May 18 12:20:24 PDT 2016
rafael added inline comments.
================
Comment at: ELF/Target.cpp:513
@@ +512,3 @@
+ return false;
+ return (S.getName() != "_DYNAMIC");
+}
----------------
Why is _DYNAMIC special?
The other checks are not architecture specific and should be in architecture independent code.
================
Comment at: ELF/Target.cpp:537
@@ -525,1 +536,3 @@
+ case R_X86_64_REX_GOTPCRELX:
+ return canRelaxGotPCRel(S) ? R_X86_REX_RELAX_GOT_PC : R_GOT_PC;
case R_X86_64_GOTPCREL:
----------------
I would probably have this return R_GOT_PC and then have a generic logic for "can we optimize this got use". This would be somewhat similar to the fact that we optimize plt acesses to local symbols.
http://reviews.llvm.org/D15779
More information about the llvm-commits
mailing list