[llvm] d9943e7 - [Object] Add DF_1_PIE
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 1 08:56:11 PDT 2020
Author: Fangrui Song
Date: 2020-06-01T08:56:02-07:00
New Revision: d9943e7f0ce888733ee7ba91da432e5f01f7aa85
URL: https://github.com/llvm/llvm-project/commit/d9943e7f0ce888733ee7ba91da432e5f01f7aa85
DIFF: https://github.com/llvm/llvm-project/commit/d9943e7f0ce888733ee7ba91da432e5f01f7aa85.diff
LOG: [Object] Add DF_1_PIE
This flag (and the whole field DT_FLAGS_1) originated from Solaris. I intend to use it in an LLD patch D80872.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D80871
Added:
Modified:
llvm/include/llvm/BinaryFormat/ELF.h
llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test
llvm/tools/llvm-readobj/ELFDumper.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/BinaryFormat/ELF.h b/llvm/include/llvm/BinaryFormat/ELF.h
index 1a17135b6078..3957c134171e 100644
--- a/llvm/include/llvm/BinaryFormat/ELF.h
+++ b/llvm/include/llvm/BinaryFormat/ELF.h
@@ -1296,7 +1296,8 @@ enum {
DF_1_NORELOC = 0x00400000,
DF_1_SYMINTPOSE = 0x00800000, // Object has individual interposers.
DF_1_GLOBAUDIT = 0x01000000, // Global auditing required.
- DF_1_SINGLETON = 0x02000000 // Singleton symbols are used.
+ DF_1_SINGLETON = 0x02000000, // Singleton symbols are used.
+ DF_1_PIE = 0x08000000, // Object is a position-independent executable.
};
// DT_MIPS_FLAGS values.
diff --git a/llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test b/llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test
index 0f3fe44b3543..c7bd551eb754 100644
--- a/llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test
+++ b/llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test
@@ -59,7 +59,7 @@
# LLVM64-NEXT: 0x000000006FFFFEF7 TLSDESC_GOT 0x1000
# LLVM64-NEXT: 0x000000006FFFFFF9 RELACOUNT 0
# LLVM64-NEXT: 0x000000006FFFFFFA RELCOUNT 0
-# LLVM64-NEXT: 0x000000006FFFFFFB FLAGS_1 NOW GLOBAL GROUP NODELETE LOADFLTR INITFIRST NOOPEN ORIGIN DIRECT TRANS INTERPOSE NODEFLIB NODUMP CONFALT ENDFILTEE DISPRELDNE DISPRELPND NODIRECT IGNMULDEF NOKSYMS NOHDR EDITED NORELOC SYMINTPOSE GLOBAUDIT SINGLETON {{$}}
+# LLVM64-NEXT: 0x000000006FFFFFFB FLAGS_1 NOW GLOBAL GROUP NODELETE LOADFLTR INITFIRST NOOPEN ORIGIN DIRECT TRANS INTERPOSE NODEFLIB NODUMP CONFALT ENDFILTEE DISPRELDNE DISPRELPND NODIRECT IGNMULDEF NOKSYMS NOHDR EDITED NORELOC SYMINTPOSE GLOBAUDIT SINGLETON PIE {{$}}
# LLVM64-NEXT: 0x000000006FFFFFF0 VERSYM 0x1000
# LLVM64-NEXT: 0x000000006FFFFFFC VERDEF 0x1000
# LLVM64-NEXT: 0x000000006FFFFFFD VERDEFNUM 0
@@ -124,7 +124,7 @@
# GNU64-NEXT: 0x000000006ffffef7 (TLSDESC_GOT) 0x1000
# GNU64-NEXT: 0x000000006ffffff9 (RELACOUNT) 0
# GNU64-NEXT: 0x000000006ffffffa (RELCOUNT) 0
-# GNU64-NEXT: 0x000000006ffffffb (FLAGS_1) NOW GLOBAL GROUP NODELETE LOADFLTR INITFIRST NOOPEN ORIGIN DIRECT TRANS INTERPOSE NODEFLIB NODUMP CONFALT ENDFILTEE DISPRELDNE DISPRELPND NODIRECT IGNMULDEF NOKSYMS NOHDR EDITED NORELOC SYMINTPOSE GLOBAUDIT SINGLETON {{$}}
+# GNU64-NEXT: 0x000000006ffffffb (FLAGS_1) NOW GLOBAL GROUP NODELETE LOADFLTR INITFIRST NOOPEN ORIGIN DIRECT TRANS INTERPOSE NODEFLIB NODUMP CONFALT ENDFILTEE DISPRELDNE DISPRELPND NODIRECT IGNMULDEF NOKSYMS NOHDR EDITED NORELOC SYMINTPOSE GLOBAUDIT SINGLETON PIE {{$}}
# GNU64-NEXT: 0x000000006ffffff0 (VERSYM) 0x1000
# GNU64-NEXT: 0x000000006ffffffc (VERDEF) 0x1000
# GNU64-NEXT: 0x000000006ffffffd (VERDEFNUM) 0
@@ -349,7 +349,7 @@ ProgramHeaders:
# LLVM32-NEXT: 0x6FFFFEF7 TLSDESC_GOT 0x1000
# LLVM32-NEXT: 0x6FFFFFF9 RELACOUNT 0
# LLVM32-NEXT: 0x6FFFFFFA RELCOUNT 0
-# LLVM32-NEXT: 0x6FFFFFFB FLAGS_1 NOW GLOBAL GROUP NODELETE LOADFLTR INITFIRST NOOPEN ORIGIN DIRECT TRANS INTERPOSE NODEFLIB NODUMP CONFALT ENDFILTEE DISPRELDNE DISPRELPND NODIRECT IGNMULDEF NOKSYMS NOHDR EDITED NORELOC SYMINTPOSE GLOBAUDIT SINGLETON {{$}}
+# LLVM32-NEXT: 0x6FFFFFFB FLAGS_1 NOW GLOBAL GROUP NODELETE LOADFLTR INITFIRST NOOPEN ORIGIN DIRECT TRANS INTERPOSE NODEFLIB NODUMP CONFALT ENDFILTEE DISPRELDNE DISPRELPND NODIRECT IGNMULDEF NOKSYMS NOHDR EDITED NORELOC SYMINTPOSE GLOBAUDIT SINGLETON PIE {{$}}
# LLVM32-NEXT: 0x6FFFFFF0 VERSYM 0x1000
# LLVM32-NEXT: 0x6FFFFFFC VERDEF 0x1000
# LLVM32-NEXT: 0x6FFFFFFD VERDEFNUM 0
@@ -414,7 +414,7 @@ ProgramHeaders:
# GNU32-NEXT: 0x6ffffef7 (TLSDESC_GOT) 0x1000
# GNU32-NEXT: 0x6ffffff9 (RELACOUNT) 0
# GNU32-NEXT: 0x6ffffffa (RELCOUNT) 0
-# GNU32-NEXT: 0x6ffffffb (FLAGS_1) NOW GLOBAL GROUP NODELETE LOADFLTR INITFIRST NOOPEN ORIGIN DIRECT TRANS INTERPOSE NODEFLIB NODUMP CONFALT ENDFILTEE DISPRELDNE DISPRELPND NODIRECT IGNMULDEF NOKSYMS NOHDR EDITED NORELOC SYMINTPOSE GLOBAUDIT SINGLETON {{$}}
+# GNU32-NEXT: 0x6ffffffb (FLAGS_1) NOW GLOBAL GROUP NODELETE LOADFLTR INITFIRST NOOPEN ORIGIN DIRECT TRANS INTERPOSE NODEFLIB NODUMP CONFALT ENDFILTEE DISPRELDNE DISPRELPND NODIRECT IGNMULDEF NOKSYMS NOHDR EDITED NORELOC SYMINTPOSE GLOBAUDIT SINGLETON PIE {{$}}
# GNU32-NEXT: 0x6ffffff0 (VERSYM) 0x1000
# GNU32-NEXT: 0x6ffffffc (VERDEF) 0x1000
# GNU32-NEXT: 0x6ffffffd (VERDEFNUM) 0
diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index 2c9a4b9c4900..861149ab9ca7 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -2350,7 +2350,8 @@ static const EnumEntry<unsigned> ElfDynamicDTFlags1[] = {
LLVM_READOBJ_DT_FLAG_ENT(DF_1, NORELOC),
LLVM_READOBJ_DT_FLAG_ENT(DF_1, SYMINTPOSE),
LLVM_READOBJ_DT_FLAG_ENT(DF_1, GLOBAUDIT),
- LLVM_READOBJ_DT_FLAG_ENT(DF_1, SINGLETON)
+ LLVM_READOBJ_DT_FLAG_ENT(DF_1, SINGLETON),
+ LLVM_READOBJ_DT_FLAG_ENT(DF_1, PIE),
};
static const EnumEntry<unsigned> ElfDynamicDTMipsFlags[] = {
More information about the llvm-commits
mailing list