[PATCH] D19040: Remove unnecessary load via GOT when accessing globals with PIE in x86_64

Sriraman Tallam via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 21 09:36:42 PDT 2016


tmsriram added inline comments.

================
Comment at: test/CodeGen/X86/global-access-pie.ll:30
@@ +29,3 @@
+; X64-LABEL: my_access_global_b:
+; X64:       movq b at GOTPCREL(%rip), %rax
+; X64-NEXT:  movl (%rax), %eax
----------------
AsafBadouh wrote:
> I think that weak global symbols should not be referred with GOT.
> gcc5.3.0 for example will generate:
>             mov b(%rip), %rax
> 
> 
> 
I agree and I know about it.  I am going to work on another patch that uses copy relocations to avoid the GOT for any kind of global access.  This what happens in GCC now with PIE.  I punted on this as this case would be handled then.  Maybe I  should not and just fix this too.


http://reviews.llvm.org/D19040





More information about the llvm-commits mailing list