Revert "[AMDGPU] Don’t marke the .note section as ALLOC"
authorMark Searles <mark.searles@amd.com>
Fri, 21 Feb 2020 23:26:51 +0000 (15:26 -0800)
committerMark Searles <mark.searles@amd.com>
Sat, 22 Feb 2020 00:08:30 +0000 (16:08 -0800)
This reverts commit 977cd661cf019039dec7ffdd15bf0ac500828c87.

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.

Differential Revision: https://reviews.llvm.org/D74995

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

index 3c52de9..c7ccd0a 100644 (file)
@@ -440,7 +440,7 @@ void AMDGPUTargetELFStreamer::EmitNote(
 
   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
index c78239e..3462398 100644 (file)
@@ -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