[llvm] r238151 - [llvm-readobj/ELF] Teach how to decode DF_1_XXX flags
Davide Italiano
davide at freebsd.org
Mon May 25 12:12:19 PDT 2015
Author: davide
Date: Mon May 25 14:12:18 2015
New Revision: 238151
URL: http://llvm.org/viewvc/llvm-project?rev=238151&view=rev
Log:
[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
Added:
llvm/trunk/test/tools/llvm-readobj/Inputs/dtflags.elf-x86-64 (with props)
llvm/trunk/test/tools/llvm-readobj/elf-dtflags.test
Modified:
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
Added: llvm/trunk/test/tools/llvm-readobj/Inputs/dtflags.elf-x86-64
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/Inputs/dtflags.elf-x86-64?rev=238151&view=auto
==============================================================================
Binary file - no diff available.
Propchange: llvm/trunk/test/tools/llvm-readobj/Inputs/dtflags.elf-x86-64
------------------------------------------------------------------------------
svn:executable = *
Propchange: llvm/trunk/test/tools/llvm-readobj/Inputs/dtflags.elf-x86-64
------------------------------------------------------------------------------
svn:mime-type = application/x-executable
Added: llvm/trunk/test/tools/llvm-readobj/elf-dtflags.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/elf-dtflags.test?rev=238151&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/elf-dtflags.test (added)
+++ llvm/trunk/test/tools/llvm-readobj/elf-dtflags.test Mon May 25 14:12:18 2015
@@ -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
Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=238151&r1=238150&r2=238151&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Mon May 25 14:12:18 2015
@@ -778,6 +778,7 @@ static const char *getTypeString(uint64_
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> ElfDyna
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<ELF
case DT_FLAGS:
printFlags(Value, makeArrayRef(ElfDynamicDTFlags), OS);
break;
+ case DT_FLAGS_1:
+ printFlags(Value, makeArrayRef(ElfDynamicDTFlags1), OS);
+ break;
}
}
More information about the llvm-commits
mailing list