mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
[llvm-readelf] Add -e/--headers support to readobj/elf
Differential Revision: https://reviews.llvm.org/D55298 llvm-svn: 348859
This commit is contained in:
parent
0b7311fee6
commit
984fc2ddc8
5
test/tools/llvm-readobj/headers.test
Normal file
5
test/tools/llvm-readobj/headers.test
Normal file
@ -0,0 +1,5 @@
|
||||
RUN: llvm-readelf -e %p/Inputs/trivial.obj.elf-i386 > %t.e
|
||||
RUN: llvm-readelf --headers %p/Inputs/trivial.obj.elf-i386 > %t.headers
|
||||
RUN: llvm-readelf -h -l -S %p/Inputs/trivial.obj.elf-i386 > %t.hlS
|
||||
RUN: cmp %t.e %t.headers
|
||||
RUN: cmp %t.e %t.hlS
|
@ -57,6 +57,14 @@ namespace opts {
|
||||
"--section-groups and --elf-hash-histogram."));
|
||||
cl::alias AllShort("a", cl::desc("Alias for --all"), cl::aliasopt(All));
|
||||
|
||||
// --headers -e
|
||||
cl::opt<bool>
|
||||
Headers("headers",
|
||||
cl::desc("Equivalent to setting: --file-headers, --program-headers, "
|
||||
"--section-headers"));
|
||||
cl::alias HeadersShort("e", cl::desc("Alias for --headers"),
|
||||
cl::aliasopt(Headers));
|
||||
|
||||
// -wide, -W
|
||||
cl::opt<bool>
|
||||
WideOutput("wide", cl::desc("Ignored for compatibility with GNU readelf"),
|
||||
@ -666,6 +674,12 @@ int main(int argc, const char *argv[]) {
|
||||
opts::HashHistogram = true;
|
||||
}
|
||||
|
||||
if (opts::Headers) {
|
||||
opts::FileHeaders = true;
|
||||
opts::ProgramHeaders = true;
|
||||
opts::SectionHeaders = true;
|
||||
}
|
||||
|
||||
// Default to stdin if no filename is specified.
|
||||
if (opts::InputFilenames.size() == 0)
|
||||
opts::InputFilenames.push_back("-");
|
||||
|
Loading…
Reference in New Issue
Block a user