[lld] r276301 - [ELF] Fix bug in program header FLAGS processing + test case update (found by grimar)
Eugene Leviant via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 21 09:13:54 PDT 2016
Author: evgeny777
Date: Thu Jul 21 11:13:54 2016
New Revision: 276301
URL: http://llvm.org/viewvc/llvm-project?rev=276301&view=rev
Log:
[ELF] Fix bug in program header FLAGS processing + test case update (found by grimar)
Modified:
lld/trunk/ELF/LinkerScript.cpp
lld/trunk/test/ELF/linkerscript-phdrs-flags.s
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=276301&r1=276300&r2=276301&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Thu Jul 21 11:13:54 2016
@@ -413,7 +413,6 @@ LinkerScript<ELFT>::createPhdrs(ArrayRef
Phdrs[Id].add(Sec);
if (Opt.PhdrsCommands[Id].Flags == UINT_MAX)
Phdrs[Id].H.p_flags |= toPhdrFlags(Sec->getFlags());
- Phdrs[Id].H.p_flags |= toPhdrFlags(Sec->getFlags());
}
} else {
// If we have no load segment or flags've changed then we want new load
Modified: lld/trunk/test/ELF/linkerscript-phdrs-flags.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript-phdrs-flags.s?rev=276301&r1=276300&r2=276301&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript-phdrs-flags.s (original)
+++ lld/trunk/test/ELF/linkerscript-phdrs-flags.s Thu Jul 21 11:13:54 2016
@@ -1,6 +1,6 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
-# RUN: echo "PHDRS {all PT_LOAD FILEHDR PHDRS FLAGS (7);} \
+# RUN: echo "PHDRS {all PT_LOAD FILEHDR PHDRS FLAGS (1);} \
# RUN: SECTIONS { \
# RUN: . = 0x10000200; \
# RUN: .text : {*(.text.*)} :all \
@@ -17,9 +17,7 @@
# CHECK-NEXT: PhysicalAddress: 0x10000000
# CHECK-NEXT: FileSize: 521
# CHECK-NEXT: MemSize: 521
-# CHECK-NEXT: Flags [ (0x7)
-# CHECK-NEXT: PF_R (0x4)
-# CHECK-NEXT: PF_W (0x2)
+# CHECK-NEXT: Flags [ (0x1)
# CHECK-NEXT: PF_X (0x1)
# CHECK-NEXT: ]
@@ -31,6 +29,6 @@ _start:
foo1:
.long 0
-.section .foo.2,"a"
+.section .foo.2,"aw"
foo2:
.long 0
More information about the llvm-commits
mailing list