1
0
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:
Sid Manning 2018-12-11 16:15:03 +00:00
parent 0b7311fee6
commit 984fc2ddc8
2 changed files with 19 additions and 0 deletions

View 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

View File

@ -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("-");