[PATCH] D33869: [llvm-readobj] Install llvm-readelf alias
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 18 19:12:42 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL308408: [llvm-readobj] Install llvm-readelf alias (authored by phosek).
Changed prior to commit:
https://reviews.llvm.org/D33869?vs=101340&id=107233#toc
Repository:
rL LLVM
https://reviews.llvm.org/D33869
Files:
llvm/trunk/test/CMakeLists.txt
llvm/trunk/test/tools/llvm-readobj/gnu-sections.test
llvm/trunk/tools/llvm-readobj/CMakeLists.txt
llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp
Index: llvm/trunk/test/tools/llvm-readobj/gnu-sections.test
===================================================================
--- llvm/trunk/test/tools/llvm-readobj/gnu-sections.test
+++ llvm/trunk/test/tools/llvm-readobj/gnu-sections.test
@@ -8,6 +8,8 @@
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
Index: llvm/trunk/test/CMakeLists.txt
===================================================================
--- llvm/trunk/test/CMakeLists.txt
+++ llvm/trunk/test/CMakeLists.txt
@@ -67,6 +67,7 @@
llvm-profdata
llvm-ranlib
llvm-readobj
+ llvm-readelf
llvm-rtdyld
llvm-size
llvm-split
Index: llvm/trunk/tools/llvm-readobj/CMakeLists.txt
===================================================================
--- llvm/trunk/tools/llvm-readobj/CMakeLists.txt
+++ llvm/trunk/tools/llvm-readobj/CMakeLists.txt
@@ -20,3 +20,5 @@
WasmDumper.cpp
Win64EHDumper.cpp
)
+
+add_llvm_tool_symlink(llvm-readelf llvm-readobj)
Index: llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp
===================================================================
--- llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp
+++ llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp
@@ -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,15 +545,19 @@
}
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;
// Register the target printer for --version.
cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion);
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33869.107233.patch
Type: text/x-patch
Size: 2494 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170719/d791fa4b/attachment.bin>
More information about the llvm-commits
mailing list