[PATCH] D74995: [AMDGPU] Revert 'Don’t marke the .note section as ALLOC'

Mark Searles via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 21 15:53:10 PST 2020


msearles created this revision.
msearles added reviewers: kzhuravl, nhaehnle, Flakebi.
msearles added projects: LLVM, AMDGPU.
Herald added subscribers: kerbowa, hiraditya, t-tye, Anastasia, tpr, dstuttard, yaxunl, wdng, jvesely, arsenm.

Revert "[AMDGPU] Don’t marke the .note section as ALLOC"

This reverts commit 977cd661cf019039dec7ffdd15bf0ac500828c87 <https://reviews.llvm.org/rG977cd661cf019039dec7ffdd15bf0ac500828c87>.

It breaks OpenCL testing. OpenCL Runtime is using PT_LOAD information
to calculate memory for global variables. This commit should be relanded once
the OpenCL runtime stops relying on PT_LOAD information for calculating global
variable memory size.


https://reviews.llvm.org/D74995

Files:
  llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
  llvm/test/CodeGen/AMDGPU/hsa.ll


Index: llvm/test/CodeGen/AMDGPU/hsa.ll
===================================================================
--- llvm/test/CodeGen/AMDGPU/hsa.ll
+++ llvm/test/CodeGen/AMDGPU/hsa.ll
@@ -19,7 +19,8 @@
 ; ELF: }
 
 ; ELF: SHT_NOTE
-; ELF: Flags [ (0x0)
+; ELF: Flags [ (0x2)
+; ELF: SHF_ALLOC (0x2)
 ; ELF: ]
 ; ELF: SectionData (
 ; ELF: 0000: 04000000 08000000 01000000 414D4400
Index: llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
+++ llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
@@ -440,7 +440,7 @@
 
   S.PushSection();
   S.SwitchSection(Context.getELFSection(
-    ElfNote::SectionName, ELF::SHT_NOTE, 0));
+    ElfNote::SectionName, ELF::SHT_NOTE, ELF::SHF_ALLOC));
   S.emitIntValue(NameSZ, 4);                                  // namesz
   S.emitValue(DescSZ, 4);                                     // descz
   S.emitIntValue(NoteType, 4);                                // type


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74995.246026.patch
Type: text/x-patch
Size: 1049 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200221/8be657f9/attachment.bin>


More information about the llvm-commits mailing list