This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Emit got relocs for linkonce[_odr] constant symbols
AbandonedPublic

Authored by kzhuravl on Jul 14 2016, 9:45 AM.

Details

Reviewers
tstellarAMD

Diff Detail

Event Timeline

kzhuravl updated this revision to Diff 63994.Jul 14 2016, 9:45 AM
kzhuravl retitled this revision from to [AMDGPU] Emit got relocs for linkonce[_odr] constant symbols.
kzhuravl updated this object.
kzhuravl added a reviewer: tstellarAMD.
kzhuravl added a subscriber: llvm-commits.
lib/Target/AMDGPU/SIISelLowering.cpp
1524–1525

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.

kzhuravl abandoned this revision.Jul 15 2016, 8:13 AM

This workaround is not needed any more

lib/Target/AMDGPU/SIISelLowering.cpp
1524–1525

I agree, this was a temp workaround. I will send a separate patch for emitting read-only data to the right section