[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 25 07:10:34 PDT 2016
rafael accepted this revision.
rafael added a comment.
This revision is now accepted and ready to land.
LGTM with nits.
Thank you so much for caring this over some many redesigns. I am very happy to see that this fits nicely in the existing infrastructure.
================
Comment at: ELF/Relocations.cpp:345
@@ -343,3 +344,3 @@
-template <class ELFT>
+template <class ELFT, class uintX_t>
static RelExpr adjustExpr(const elf::ObjectFile<ELFT> &File, SymbolBody &Body,
----------------
Don't make uintX_t a template parameter. You can just use ELFT::uint
================
Comment at: ELF/Relocations.cpp:490
@@ -484,1 +489,3 @@
+ Expr = adjustExpr(File, Body, IsWrite, Expr, Type,
+ C.getSectionData().data(), Offset);
if (HasError)
----------------
Use the existing variable Buf.
================
Comment at: ELF/Target.cpp:531
@@ -518,2 +530,3 @@
case R_X86_64_GOTPCREL:
+ case R_X86_64_GOTTPOFF:
case R_X86_64_GOTPCRELX:
----------------
Now this is just moving the label, please leave it in the original location.
================
Comment at: ELF/Target.cpp:744
@@ +743,3 @@
+
+ // Convert mov foo at GOTPCREL(%rip), %reg to lea foo(%rip), %reg
+ // is the only supported relaxation for now.
----------------
Converting
http://reviews.llvm.org/D15779
More information about the llvm-commits
mailing list