[llvm] r308396 - [llvm-readobj] Accept (and ignore) --wide (-W) command-line switch
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 18 16:58:15 PDT 2017
Author: phosek
Date: Tue Jul 18 16:58:15 2017
New Revision: 308396
URL: http://llvm.org/viewvc/llvm-project?rev=308396&view=rev
Log:
[llvm-readobj] Accept (and ignore) --wide (-W) command-line switch
Accept and ignore --wide/-W. In GNU readelf this switch is
necessary to get the output format that's consistent between
32-bit and 64-bit targets. llvm-readobj always produces that
output format.
Patch by Roland McGrath
Differential Revision: https://reviews.llvm.org/D33873
Modified:
llvm/trunk/test/tools/llvm-readobj/gnu-sections.test
llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp
Modified: llvm/trunk/test/tools/llvm-readobj/gnu-sections.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/gnu-sections.test?rev=308396&r1=308395&r2=308396&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/gnu-sections.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/gnu-sections.test Tue Jul 18 16:58:15 2017
@@ -2,6 +2,12 @@ RUN: llvm-readobj -s %p/Inputs/relocs.ob
RUN: | FileCheck %s -check-prefix ELF32
RUN: llvm-readobj -S %p/Inputs/relocs.obj.elf-x86_64 --elf-output-style=GNU \
RUN: | FileCheck %s -check-prefix ELF64
+RUN: llvm-readobj --wide --sections \
+RUN: %p/Inputs/relocs.obj.elf-x86_64 --elf-output-style=GNU \
+RUN: | FileCheck %s -check-prefix ELF64
+RUN: llvm-readobj -W --sections \
+RUN: %p/Inputs/relocs.obj.elf-x86_64 --elf-output-style=GNU \
+RUN: | FileCheck %s -check-prefix ELF64
ELF32: Section Headers:
ELF32-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al
Modified: llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp?rev=308396&r1=308395&r2=308396&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp Tue Jul 18 16:58:15 2017
@@ -50,6 +50,13 @@ namespace opts {
cl::desc("<input object files>"),
cl::ZeroOrMore);
+ // -wide, -W
+ cl::opt<bool> WideOutput("wide",
+ cl::desc("Ignored for compatibility with GNU readelf"));
+ cl::alias WideOutputShort("W",
+ cl::desc("Alias for --wide"),
+ cl::aliasopt(WideOutput));
+
// -file-headers, -h
cl::opt<bool> FileHeaders("file-headers",
cl::desc("Display file headers "));
@@ -544,6 +551,8 @@ int main(int argc, const char *argv[]) {
// Register the target printer for --version.
cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion);
+ opts::WideOutput.setHiddenFlag(cl::Hidden);
+
cl::ParseCommandLineOptions(argc, argv, "LLVM Object Reader\n");
// Default to stdin if no filename is specified.
More information about the llvm-commits
mailing list