mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-18 18:42:46 +02:00
[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 llvm-svn: 308408
This commit is contained in:
parent
a0ad631f4e
commit
72231eb582
@ -67,6 +67,7 @@ set(LLVM_TEST_DEPENDS
|
||||
llvm-profdata
|
||||
llvm-ranlib
|
||||
llvm-readobj
|
||||
llvm-readelf
|
||||
llvm-rtdyld
|
||||
llvm-size
|
||||
llvm-split
|
||||
|
@ -8,6 +8,8 @@ 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
|
||||
RUN: llvm-readelf -W -S %p/Inputs/relocs.obj.elf-x86_64 \
|
||||
RUN: | FileCheck %s -check-prefix ELF64
|
||||
|
||||
ELF32: Section Headers:
|
||||
ELF32-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al
|
||||
|
@ -20,3 +20,5 @@ add_llvm_tool(llvm-readobj
|
||||
WasmDumper.cpp
|
||||
Win64EHDumper.cpp
|
||||
)
|
||||
|
||||
add_llvm_tool_symlink(llvm-readelf llvm-readobj)
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/FileSystem.h"
|
||||
#include "llvm/Support/ManagedStatic.h"
|
||||
#include "llvm/Support/Path.h"
|
||||
#include "llvm/Support/PrettyStackTrace.h"
|
||||
#include "llvm/Support/ScopedPrinter.h"
|
||||
#include "llvm/Support/Signals.h"
|
||||
@ -544,7 +545,8 @@ static void dumpInput(StringRef File) {
|
||||
}
|
||||
|
||||
int main(int argc, const char *argv[]) {
|
||||
sys::PrintStackTraceOnErrorSignal(argv[0]);
|
||||
StringRef ToolName = argv[0];
|
||||
sys::PrintStackTraceOnErrorSignal(ToolName);
|
||||
PrettyStackTraceProgram X(argc, argv);
|
||||
llvm_shutdown_obj Y;
|
||||
|
||||
@ -553,6 +555,9 @@ int main(int argc, const char *argv[]) {
|
||||
|
||||
opts::WideOutput.setHiddenFlag(cl::Hidden);
|
||||
|
||||
if (sys::path::stem(ToolName).find("readelf") != StringRef::npos)
|
||||
opts::Output = opts::GNU;
|
||||
|
||||
cl::ParseCommandLineOptions(argc, argv, "LLVM Object Reader\n");
|
||||
|
||||
// Default to stdin if no filename is specified.
|
||||
|
Loading…
Reference in New Issue
Block a user