[PATCH] D14627: ELF: Ignore OS bits in sh_flag when assigning 'Data' ContentType for Atoms
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 12 14:42:21 PST 2015
tstellarAMD created this revision.
tstellarAMD added a reviewer: ruiu.
tstellarAMD added a subscriber: llvm-commits.
http://reviews.llvm.org/D14627
Files:
lib/ReaderWriter/ELF/Atoms.cpp
test/elf/AMDGPU/hsa-sections.test
test/elf/AMDGPU/hsa-symbols.test
Index: test/elf/AMDGPU/hsa-symbols.test
===================================================================
--- test/elf/AMDGPU/hsa-symbols.test
+++ test/elf/AMDGPU/hsa-symbols.test
@@ -5,9 +5,9 @@
# CHECK: Symbol {
# CHECK: Name: global_agent
# CHECK: Binding: Local
-# FIXME: Should be Type: Object
-# CHECK-NOT: Type: AMDGPU_HSA_KERNEL
-
+# CHECK: Type: Object
+# CHECK: Section: .hsadata_global_agent
+# CHECK: }
---
FileHeader:
Class: ELFCLASS64
Index: test/elf/AMDGPU/hsa-sections.test
===================================================================
--- test/elf/AMDGPU/hsa-sections.test
+++ test/elf/AMDGPU/hsa-sections.test
@@ -3,6 +3,16 @@
# RUN: llvm-readobj -h -program-headers -s -symbols %t.exe | FileCheck %s
# CHECK: Section {
+# CHECK: Name: .hsarodata_readonly_agent
+# CHECK: Type: SHT_PROGBITS
+# CHECK: Flags [ (0xA00002
+# CHECK: SHF_ALLOC (0x2)
+# CHECK: SHF_AMDGPU_HSA_AGENT (0x800000)
+# CHECK: SHF_AMDGPU_HSA_READONLY (0x200000)
+# CHECK: ]
+# CHECK: }
+
+# CHECK: Section {
# CHECK: Name: .hsadata_global_agent
# CHECK: Type: SHT_PROGBITS (0x1)
# CHECK: Flags [ (0x900003
@@ -23,17 +33,6 @@
# CHECK: ]
# CHECK: }
-# CHECK: Section {
-# CHECK: Name: .hsarodata_readonly_agent
-# CHECK: Type: SHT_PROGBITS
-# CHECK: Flags [ (0xA00002
-# CHECK: SHF_ALLOC (0x2)
-# CHECK: SHF_AMDGPU_HSA_AGENT (0x800000)
-# CHECK: SHF_AMDGPU_HSA_READONLY (0x200000)
-# CHECK: ]
-# CHECK: }
-
-
# CHECK: ProgramHeader {
# CHECK: Type: PT_AMDGPU_HSA_LOAD_GLOBAL_PROGRAM (0x60000000)
# CHECK: }
Index: lib/ReaderWriter/ELF/Atoms.cpp
===================================================================
--- lib/ReaderWriter/ELF/Atoms.cpp
+++ lib/ReaderWriter/ELF/Atoms.cpp
@@ -92,6 +92,7 @@
if (_section->sh_type == SHT_PROGBITS) {
flags &= ~SHF_ALLOC;
flags &= ~SHF_GROUP;
+ flags &= ~SHF_MASKOS;
if ((flags & SHF_STRINGS) || (flags & SHF_MERGE))
return typeConstant;
if (flags == SHF_WRITE)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14627.40089.patch
Type: text/x-patch
Size: 1964 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151112/b314b1d5/attachment.bin>
More information about the llvm-commits
mailing list