mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-29 08:31:13 +00:00
[llvm-readobj/ELF] Teach how to decode DF_1_XXX flags
llvm-readobj -dynamic-table output. Before: 0x000000006FFFFFFB unknown After: 0x000000006FFFFFFB FLAGS_1 NOW ORIGIN Differential Revision: http://reviews.llvm.org/D9958 llvm-svn: 238151
This commit is contained in:
parent
cd62518369
commit
f071bd0a18
BIN
llvm/test/tools/llvm-readobj/Inputs/dtflags.elf-x86-64
Executable file
BIN
llvm/test/tools/llvm-readobj/Inputs/dtflags.elf-x86-64
Executable file
Binary file not shown.
6
llvm/test/tools/llvm-readobj/elf-dtflags.test
Normal file
6
llvm/test/tools/llvm-readobj/elf-dtflags.test
Normal file
@ -0,0 +1,6 @@
|
||||
// Test that llvm-readobj dumps DF_XXX and DF_1_XXX flags correctly.
|
||||
|
||||
RUN: llvm-readobj -dynamic-table %p/Inputs/dtflags.elf-x86-64 | FileCheck %s
|
||||
|
||||
CHECK: 0x000000000000001E FLAGS ORIGIN BIND_NOW
|
||||
CHECK: 0x000000006FFFFFFB FLAGS_1 NOW ORIGIN
|
@ -778,6 +778,7 @@ static const char *getTypeString(uint64_t Type) {
|
||||
LLVM_READOBJ_TYPE_CASE(FINI_ARRAY);
|
||||
LLVM_READOBJ_TYPE_CASE(FINI_ARRAYSZ);
|
||||
LLVM_READOBJ_TYPE_CASE(FLAGS);
|
||||
LLVM_READOBJ_TYPE_CASE(FLAGS_1);
|
||||
LLVM_READOBJ_TYPE_CASE(HASH);
|
||||
LLVM_READOBJ_TYPE_CASE(INIT);
|
||||
LLVM_READOBJ_TYPE_CASE(INIT_ARRAY);
|
||||
@ -837,6 +838,34 @@ static const EnumEntry<unsigned> ElfDynamicDTFlags[] = {
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF, STATIC_TLS)
|
||||
};
|
||||
|
||||
static const EnumEntry<unsigned> ElfDynamicDTFlags1[] = {
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, NOW),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, GLOBAL),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, GROUP),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, NODELETE),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, LOADFLTR),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, INITFIRST),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, NOOPEN),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, ORIGIN),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, DIRECT),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, TRANS),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, INTERPOSE),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, NODEFLIB),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, NODUMP),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, CONFALT),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, ENDFILTEE),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, DISPRELDNE),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, NODIRECT),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, IGNMULDEF),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, NOKSYMS),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, NOHDR),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(DF_1, EDITED),
|
||||
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)
|
||||
};
|
||||
|
||||
static const EnumEntry<unsigned> ElfDynamicDTMipsFlags[] = {
|
||||
LLVM_READOBJ_DT_FLAG_ENT(RHF, NONE),
|
||||
LLVM_READOBJ_DT_FLAG_ENT(RHF, QUICKSTART),
|
||||
@ -950,6 +979,9 @@ static void printValue(const ELFFile<ELFT> *O, uint64_t Type, uint64_t Value,
|
||||
case DT_FLAGS:
|
||||
printFlags(Value, makeArrayRef(ElfDynamicDTFlags), OS);
|
||||
break;
|
||||
case DT_FLAGS_1:
|
||||
printFlags(Value, makeArrayRef(ElfDynamicDTFlags1), OS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user