summaryrefslogtreecommitdiff
path: root/tools/llvm-readobj
AgeCommit message (Collapse)Author
2018-01-16Merging r321980:Hans Wennborg
------------------------------------------------------------------------ r321980 | phosek | 2018-01-07 18:23:10 -0800 (Sun, 07 Jan 2018) | 5 lines [llvm-readobj] Support -needed-libs option for Mach-O files This implements the -needed-libs option in Mach-O dumper. Differential Revision: https://reviews.llvm.org/D41527 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_60@322561 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-28Fix tests after move to utohexstr.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321527 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-28Avoid int to string conversion in Twine or raw_ostream contexts.Benjamin Kramer
Some output changes from uppercase hex to lowercase hex, no other functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321526 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-27[llvm-readobj] Support -needed-libs option for COFF filesPetr Hosek
This implements the -needed-libs option in the COFF dumper. Differential Revision: https://reviews.llvm.org/D41529 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321498 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-21[llvm-readobj] Fix ambiguous call to the `printNumber`Simon Atanasyan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321254 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-21[llvm-readobj] Support 'GNU' style for MIPS GOT/PLT dumpingSimon Atanasyan
This change adds `printMipsGOT` and `printMipsPLT` methods to the `DumpStyle` class and overrides them in the `GNUStyle` and `LLVMStyle` descendants. To pass information about GOT/PLT layout into these methods, the `MipsGOTParser` class has been extended to hold all necessary data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321253 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-19[llvm-readobj] Dump wasm init functionsSam Clegg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321042 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13Remove redundant includes from tools.Michael Zolotukhin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320631 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05Teach llvm-pdbutil to dump types from object files.Zachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-02[llvm-readobj] Remove redundant local variables to reduce the code. NFCSimon Atanasyan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319617 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-02[llvm-readobj] Print static MIPS GOTSimon Atanasyan
If a linked binary file contains a dynamic section, the GOT layout defined by the dynamic section entries. In a statically linked file the GOT is just a series of entries. This change teaches `llvm-readobj` to print the GOT in that case. That provides a feature parity with GNU `readelf`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319616 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-02[llvm-readobj] Delete unused method argument. NFCSimon Atanasyan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319615 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30Split TypeTableBuilder into two classes.Zachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319456 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30[llvm-readobj] Fix mismatched line endingsZachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319453 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29Make TypeTableBuilder inherit from TypeCollection.Zachary Turner
A couple of places in LLD were passing references to TypeTableCollections around, which makes it hard to change the implementation at runtime. However, these cases only needed to iterate over the types in the collection, and TypeCollection already provides a handy abstract interface for this purpose. By implementing this interface, we can get rid of the need to pass TypeTableBuilder references around, which should allow us to swap the implementation at runtime in subsequent patches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319345 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16Attempt to fix inscrutible build break...David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318463 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16llvm-readobj/ARMEHABIPrinter.h: Make this a real/modular headerDavid Blaikie
Had several non-inline/strong function definitions that needed to be marked inline, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318461 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16Add ELF dynamic symbol support to yaml2obj/obj2yamlDave Lee
Summary: This change introduces a `DynamicSymbols` field to the ELF specific YAML supported by `yaml2obj` and `obj2yaml`. This grouping of symbols provides a way to represent ELF dynamic symbols. The `DynamicSymbols` structure is identical to the existing `Symbols`. Reviewers: compnerd, jakehehrlich, silvas Reviewed By: silvas Subscribers: silvas, jakehehrlich, llvm-commits Differential Revision: https://reviews.llvm.org/D39582 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318433 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-03Add llvm::for_each as a range-based extensions to <algorithm> and make use ↵Aaron Ballman
of it in some cases where it is a more clear alternative to std::for_each. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317356 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-02[tools] Add option to install binutils symlinksShoaib Meenai
The LLVM tools can be used as a replacement for binutils, in which case it's convenient to create symlinks with the binutils names. Add support for these symlinks in the build system. As with any other llvm tool symlinks, the user can limit the installed symlinks by only adding the desired ones to `LLVM_TOOLCHAIN_TOOLS`. Differential Revision: https://reviews.llvm.org/D39530 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317272 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-31Inline compareAddr function into its only caller. NFCI.Peter Collingbourne
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317045 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-27ELF: Add support for emitting dynamic relocations in the Android relocation ↵Peter Collingbourne
packing format. The Android relocation packing format is a more compact format for dynamic relocations in executables and DSOs that is based on delta encoding and SLEBs. An overview of the format can be found in the Android source code: https://android.googlesource.com/platform/bionic/+/refs/heads/master/tools/relocation_packer/src/delta_encoder.h This patch implements relocation packing using that format. This implementation uses a more intelligent algorithm for compressing relative relocations than Android's own relocation packer. As a result it can generally create smaller relocation sections than that packer. If I link Chromium for Android targeting ARM32 I get a .rel.dyn of size 174693 bytes, as compared to 371832 bytes with gold and the Android packer. Differential Revision: https://reviews.llvm.org/D39152 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316775 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-25llvm-readobj: Add support for reading relocations in the Android packed format.Peter Collingbourne
This is in preparation for testing lld's upcoming relocation packing feature (D39152). I have verified that this implementation correctly unpacks the relocations from a Chromium DSO built with gold and the Android relocation packer for ARM32 and ARM64. Differential Revision: https://reviews.llvm.org/D39272 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316543 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-14llvm-readobj: Print AMDGPU note contentsKonstantin Zhuravlyov
Differential Revision: https://reviews.llvm.org/D38752 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315819 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-14llvm-readobj: Print AMDGPU note type namesKonstantin Zhuravlyov
Differential Revision: https://reviews.llvm.org/D38751 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315813 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-11Convert a few ErrorOr to Expected.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315477 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-08Remove unused variables. No functionality change.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315185 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-05AMDGPU: Add and set AMDGPU-specific e_flagsKonstantin Zhuravlyov
Differential Revision: https://reviews.llvm.org/D38556 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314987 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-03AMDGPU: Add ELFOSABI_AMDGPU_MESA3DKonstantin Zhuravlyov
Differential Revision: https://reviews.llvm.org/D38387 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314846 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-03AMDGPU: Add ELFOSABI_AMDGPU_PALKonstantin Zhuravlyov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314843 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-03[llvm-readobj][RISCV] Pretty-print RISCV e_flagsAlex Bradbury
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314772 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-02Add ELFOSABI_FIRST_ARCH, ELFOSABI_LAST_ARCH and start using those in ↵Konstantin Zhuravlyov
llvm-readobj Differential Revision: https://reviews.llvm.org/D38418 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314717 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-29[WebAssembly] Allow each data segment to specify its own alignmentSam Clegg
Also, add a flags field as we will almost certainly be needing that soon too. Differential Revision: https://reviews.llvm.org/D38296 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314534 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-29llvm-readobj: fix a few typos (NFC)Saleem Abdulrasool
Correct the spelling of multiple in a couple of sites. Patch by Alex Langford! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314485 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-27Update the description of AVR32 for the ELFDumperDylan McKay
AVR32 is an unrelated architecture with 32-bit addressing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314359 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21[llvm-readobj] Fix big-endian byte swap in WindowsResourceDumper.Marek Sokolowski
The previous version of dumper implemented UTF-16 byte swap incorrectly on big-endian machines. This now gets fixed. Thanks to Bill Seurer for testing the patch locally. Differential Review: https://reviews.llvm.org/D38150 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313912 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20[llvm-readobj] Fix 'Teach readobj to dump .res files', pt 3.Marek Sokolowski
Fix (r313790) missing ulittle{}_t error on some buildbots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313834 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20[llvm-readobj] Fix 'Teach readobj to dump .res files', pt 2.Marek Sokolowski
Another fix-up for r313790. Big-endian hosts swapped byte order in UTF16 words. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313833 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20[llvm-readobj] Fix 'Teach readobj to dump .res files'.Marek Sokolowski
Fix-up for r313790. Some buildbots couldn't convert size_t to uint{}_t; do it manually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313816 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20Reland "[WebAssembly] Add support for naming wasm data segments"Sam Clegg
Add adds support for naming data segments. This is useful useful linkers so that they can merge similar sections. Differential Revision: https://reviews.llvm.org/D37886 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313795 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20[llvm-readobj] Teach readobj to dump .res files (WindowsResource).Marek Sokolowski
This enables readobj to output Windows resource files (.res). This way, we'll be able to test .res outputs without comparing them byte-by-byte with "magic binary files" generated by MS toolchain. Differential Revision: https://reviews.llvm.org/D38058 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313790 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20Reverting due to Green Dragon bot failure.Mike Edwards
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/42594/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313706 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19[WebAssembly] Add support for naming wasm data segmentsSam Clegg
Add adds support for naming data segments. This is useful useful linkers so that they can merge similar sections. Differential Revision: https://reviews.llvm.org/D37886 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313692 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16[llvm-readobj] - Teach tool to report error if some section is in multiple ↵George Rimar
COMDAT groups at once. readelf tool reports an error when output contains the same section in multiple COMDAT groups. That can be useful. Path teaches llvm-readobj to do the same. Differential revision: https://reviews.llvm.org/D37567 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313459 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14Recommit r313234 "[llvm-readobj] - Refactor printGroupSections methods."George Rimar
With fix in formatting for GNU style output. Original commit message: This refactors GNUStyle<ELFT>::printGroupSections and LLVMStyle<ELFT>::printGroupSections to split out all duplicated code. After the change these methods just prints the data provided by introduced getGroups in a corresponding LLVM/GNU format. Differential revision: https://reviews.llvm.org/D37621 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313236 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14Revert r313234 "[llvm-readobj] - Refactor printGroupSections methods."George Rimar
It broke BB. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313235 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14[llvm-readobj] - Refactor printGroupSections methods.George Rimar
This refactors GNUStyle<ELFT>::printGroupSections and LLVMStyle<ELFT>::printGroupSections to split out all duplicated code. After the change these methods just prints the data provided by introduced getGroups in a corresponding LLVM/GNU format. Differential revision: https://reviews.llvm.org/D37621 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313234 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-01[WebAssembly] Update relocation names to match specSam Clegg
Summary: See https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md Differential Revision: https://reviews.llvm.org/D37385 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312342 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26Follow up for r307085: a better fix for a dangling StringRef.Alexander Kornienko
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309092 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-19[llvm-readobj] Install llvm-readelf aliasPetr Hosek
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