[PATCH] D22366: [AMDGPU] Emit got relocs for linkonce[_odr] constant symbols

Konstantin Zhuravlyov via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 08:13:12 PDT 2016


kzhuravl abandoned this revision.
kzhuravl added a comment.

This workaround is not needed any more


================
Comment at: lib/Target/AMDGPU/SIISelLowering.cpp:1524-1525
@@ -1523,3 +1523,4 @@
                                const TargetMachine &TM) {
-  return GV->getType()->getAddressSpace() == AMDGPUAS::GLOBAL_ADDRESS &&
+  return (GV->getType()->getAddressSpace() == AMDGPUAS::GLOBAL_ADDRESS ||
+            GV->hasLinkOnceLinkage() || GV->hasLinkOnceODRLinkage()) &&
          !TM.shouldAssumeDSOLocal(*GV->getParent(), GV);
----------------
tstellarAMD wrote:
> What we do currently is to emit read-only data to the .text section, and then have the compiler use fixups to resolve the offsets.  So, we don't really need to be emitting relocations or these type of symbols at all.
> 
> However, it's really not correct to emit read-only data to the .text section, so I think we should fix this.  We need to update the callback in AMDGPUTargetObjectFile.cpp to emit constant to the correct section (but only for isAmdHsaOS()), and then here we shouldn't be special casing linkonce/linkonce_odr we should be emitting GOTs for all constant address space variables that are not DSOLocal.
I agree, this was a temp workaround. I will send a separate patch for emitting read-only data to the right section


https://reviews.llvm.org/D22366





More information about the llvm-commits mailing list