From: Mark Searles Date: Fri, 21 Feb 2020 23:26:51 +0000 (-0800) Subject: Revert "[AMDGPU] Don’t marke the .note section as ALLOC" X-Git-Tag: llvmorg-12-init~13914 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d3e170c4388693b6628fa91cbf78506a5fb45439;p=platform%2Fupstream%2Fllvm.git Revert "[AMDGPU] Don’t marke the .note section as ALLOC" 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 --- diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp index 3c52de9..c7ccd0a 100644 --- a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp +++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp @@ -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 diff --git a/llvm/test/CodeGen/AMDGPU/hsa.ll b/llvm/test/CodeGen/AMDGPU/hsa.ll index c78239e..3462398 100644 --- a/llvm/test/CodeGen/AMDGPU/hsa.ll +++ b/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