[PATCH] D74600: [AMDGPU] Don’t marke the .note section as ALLOC

Sebastian Neubauer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 14 03:15:26 PST 2020


sebastian-ne created this revision.
sebastian-ne added reviewers: nhaehnle, arsenm.
Herald added subscribers: llvm-commits, kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.

Marking a section as ALLOC tells the ELF loader to load the section into memory.
As we do not want to load the notes into VRAM, the flag should not be there.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74600

Files:
  llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp


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, ELF::SHF_ALLOC));
+    ElfNote::SectionName, ELF::SHT_NOTE, 0));
   S.EmitIntValue(NameSZ, 4);                                  // namesz
   S.EmitValue(DescSZ, 4);                                     // descz
   S.EmitIntValue(NoteType, 4);                                // type


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74600.244605.patch
Type: text/x-patch
Size: 673 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200214/0a3ffb11/attachment.bin>


More information about the llvm-commits mailing list