llvm.org GIT mirror llvm / f144b00
[llvm-readobj] Install llvm-readelf alias Install an llvm-readelf symlink to llvm-readobj. When invoked as *readelf*, default to -elf-output-style=GNU. Patch by Roland McGrath Differential Revision: https://reviews.llvm.org/D33869 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308408 91177308-0d34-0410-b5e6-96231b3b80d8 Petr Hosek 2 years ago
4 changed file(s) with 11 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
6666 llvm-profdata
6767 llvm-ranlib
6868 llvm-readobj
69 llvm-readelf
6970 llvm-rtdyld
7071 llvm-size
7172 llvm-split
66 RUN: | FileCheck %s -check-prefix ELF64
77 RUN: llvm-readobj -W --sections \
88 RUN: %p/Inputs/relocs.obj.elf-x86_64 --elf-output-style=GNU \
9 RUN: | FileCheck %s -check-prefix ELF64
10 RUN: llvm-readelf -W -S %p/Inputs/relocs.obj.elf-x86_64 \
911 RUN: | FileCheck %s -check-prefix ELF64
1012
1113 ELF32: Section Headers:
1919 WasmDumper.cpp
2020 Win64EHDumper.cpp
2121 )
22
23 add_llvm_tool_symlink(llvm-readelf llvm-readobj)
3333 #include "llvm/Support/Debug.h"
3434 #include "llvm/Support/FileSystem.h"
3535 #include "llvm/Support/ManagedStatic.h"
36 #include "llvm/Support/Path.h"
3637 #include "llvm/Support/PrettyStackTrace.h"
3738 #include "llvm/Support/ScopedPrinter.h"
3839 #include "llvm/Support/Signals.h"
543544 }
544545
545546 int main(int argc, const char *argv[]) {
546 sys::PrintStackTraceOnErrorSignal(argv[0]);
547 StringRef ToolName = argv[0];
548 sys::PrintStackTraceOnErrorSignal(ToolName);
547549 PrettyStackTraceProgram X(argc, argv);
548550 llvm_shutdown_obj Y;
549551
551553 cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion);
552554
553555 opts::WideOutput.setHiddenFlag(cl::Hidden);
556
557 if (sys::path::stem(ToolName).find("readelf") != StringRef::npos)
558 opts::Output = opts::GNU;
554559
555560 cl::ParseCommandLineOptions(argc, argv, "LLVM Object Reader\n");
556561