summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj/ELFDumper.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-readobj] Generic hex-dump optionPaul Semel2018-07-251-18/+0
| | | | | | | | | | Helpers are available to make this option file format independant. This patch adds the feature for Wasm file format. It doesn't change the behavior of the other file format handling. Differential Revision: https://reviews.llvm.org/D49545 llvm-svn: 337896
* [llvm-readobj] - Do not report invalid amount of sections.George Rimar2018-07-191-2/+4
| | | | | | | | | | | When output style is GNU and amount of sections is >= SHN_LORESERVE, llvm-readobj reports zero number of sections instead of actual value. The patch fixes that. Differential revision: https://reviews.llvm.org/D49544 llvm-svn: 337462
* [llvm-readobj] Generic -string-dump optionPaul Semel2018-07-181-72/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D49470 llvm-svn: 337408
* [llvm-readobj] - Teach tool to dump objects with >= SHN_LORESERVE of sections.George Rimar2018-07-181-4/+28
| | | | | | | | | | | | | | | | | | http://www.sco.com/developers/gabi/2003-12-17/ch4.eheader.html says that e_shnum and/or e_shstrndx may have special values if "the number of sections is greater than or equal to SHN_LORESERVE" or "the section name string table section index is greater than or equal to SHN_LORESERVE (0xff00)" Previously llvm-readobj was unable to dump such files, patch changes that. I had to add a precompiled test case because it does not seem possible to prepare a test using yaml2obj or llvm-mc (not clear how to make .shstrtab to have index >= SHN_LORESERVE). Differential revision: https://reviews.llvm.org/D49369 llvm-svn: 337360
* MC: Implement support for new .addrsig and .addrsig_sym directives.Peter Collingbourne2018-07-171-0/+45
| | | | | | | | | Part of the address-significance tables proposal: http://lists.llvm.org/pipermail/llvm-dev/2018-May/123514.html Differential Revision: https://reviews.llvm.org/D47744 llvm-svn: 337328
* [WebAssembly] Remove ELF file support.Sam Clegg2018-07-161-1/+0
| | | | | | | | | This support was partial and temporary. Now that we have wasm object file support its no longer needed. Differential Revision: https://reviews.llvm.org/D48744 llvm-svn: 337222
* [llvm-readobj] Add -hex-dump (-x) optionPaul Semel2018-07-111-0/+18
| | | | | | Differential Revision: https://reviews.llvm.org/D48281 llvm-svn: 336782
* Revert "[llvm-readobj] Fix printing format"Paul Semel2018-07-011-11/+4
| | | | | | | There is a problem with the formatting on windows build. I need to investigate on this. llvm-svn: 336061
* [llvm-readobj] Fix printing formatPaul Semel2018-07-011-4/+11
| | | | | | | | | | | | We were printing every character, even those that weren't printable. It doesn't really make sense for this option. The string content was sticked to its address, added two spaces in between. Differential Revision: https://reviews.llvm.org/D48271 llvm-svn: 336058
* [llvm-readobj] Add experimental support for SHT_RELR sectionsJake Ehrlich2018-06-281-18/+109
| | | | | | | | | | | | | | | This change adds experimental support for SHT_RELR sections, proposed here: https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg Definitions for the new ELF section type and dynamic array tags, as well as the encoding used in the new section are all under discussion and are subject to change. Use with caution! Author: rahulchaudhry Differential Revision: https://reviews.llvm.org/D47919 llvm-svn: 335922
* [llvm-readobj] Add -string-dump (-p) optionPaul Semel2018-06-151-0/+72
| | | | | | | | This option prints the section content as a string. Differential Revision: https://reviews.llvm.org/D47989 llvm-svn: 334834
* llvm-readobj: fix printing number of relocations in Android packed format.Peter Collingbourne2018-06-071-1/+9
| | | | | | | | | | | | | With '-elf-output-style=GNU -relocations', a header containing the number of entries is printed before all the relocation entries in the section. For Android packed format, we need to perform the unpacking first before we can get the actual number of relocations in the section. Patch by Rahul Chaudhry! Differential Revision: https://reviews.llvm.org/D47800 llvm-svn: 334147
* [llvm-readobj] Support GNU_PROPERTY_X86_FEATURE_1_AND notes in ↵Alexander Ivchenko2018-06-041-1/+31
| | | | | | | | | | | | | | | | | .note.gnu.property Resubmit of r333424. This version contains the fix for fails found by buildbots on some targets. This patch allows parsing GNU_PROPERTY_X86_FEATURE_1_AND notes in .note.gnu.property sections. These notes indicate that the object file is built to support Intel CET. patch by mike.dvoretsky Differential Revision: https://reviews.llvm.org/D47473 llvm-svn: 333908
* [MC] Add assembler support for .cg_profile.Michael J. Spencer2018-06-021-0/+52
| | | | | | | | | | | | | | | Object FIle Representation At codegen time this is emitted into the ELF file a pair of symbol indices and a weight. In assembly it looks like: .cg_profile a, b, 32 .cg_profile freq, a, 11 .cg_profile freq, b, 20 When writing an ELF file these are put into a SHT_LLVM_CALL_GRAPH_PROFILE (0x6fff4c02) section as (uint32_t, uint32_t, uint64_t) tuples as (from symbol index, to symbol index, weight). Differential Revision: https://reviews.llvm.org/D44965 llvm-svn: 333823
* Reverted r333424 as it broke multiple build bots and left unfixed for a long ↵Galina Kistanova2018-05-301-31/+1
| | | | | | time llvm-svn: 333578
* [llvm-readobj] Support GNU_PROPERTY_X86_FEATURE_1_AND notes in ↵Alexander Ivchenko2018-05-291-1/+31
| | | | | | | | | | | | | | .note.gnu.property This patch allows parsing GNU_PROPERTY_X86_FEATURE_1_AND notes in .note.gnu.property sections. These notes indicate that the object file is built to support Intel CET. patch by mike.dvoretsky Differential Revision: https://reviews.llvm.org/D47473 llvm-svn: 333424
* [mips] Add support for Global INValidate ASEPetar Jovanovic2018-05-171-0/+1
| | | | | | | | | | | | | | | | | | This includes Instructions: ginvi, ginvt, Assembler directives: .set ginv, .set noginv, .module ginv, .module noginv Attribute: ginv .MIPS.abiflags: GINV (0x20000) Patch by Vladimir Stefanovic. Differential Revision: https://reviews.llvm.org/D46268 llvm-svn: 332624
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-011-4/+4
| | | | | | | | | | | | | | | | We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46290 llvm-svn: 331272
* AMDGPU: Add Vega12 and Vega20Matt Arsenault2018-04-301-0/+2
| | | | | | | | Changes by Matt Arsenault Konstantin Zhuravlyov llvm-svn: 331215
* Add PPC64_GLINK dynamic tag.Sean Fertile2018-04-131-0/+12
| | | | | | | | Add support for the PPC64_GLINK dynamic tag which is used in the ElfV2 abi. Differential Revision: https://reviews.llvm.org/D45574 llvm-svn: 330038
* Change DT_* value definitions to macros in a separate fileAlexander Richardson2018-03-211-69/+25
| | | | | | | | | | | | | | | | | | | | Summary: I recently added a new dynamic tag to our fork of LLVM and when adding it to llvm-readobj I noticed that not all DT_ values were being handled there. Using macros in a .def file that can be included by both ELFDumper.cpp and the ELF.h header ensures that the two don't get out of sync when new values are added. Reviewers: grimar, pcc, davide, espindola Reviewed By: grimar, espindola Subscribers: srhines, llvm-commits Differential Revision: https://reviews.llvm.org/D44558 llvm-svn: 328099
* [llvm-readobj] - Teach llvm-readobj to dump .note.gnu.property sections.George Rimar2018-03-211-1/+52
| | | | | | | | | | | | NT_GNU_PROPERTY_TYPE_0 is a recently added type of .note.gnu.property section specified in Linux Extensions to gABI. (https://github.com/hjl-tools/linux-abi/wiki/Linux-Extensions-to-gABI) Patch teach tool to print such notes properly. Differential revision: https://reviews.llvm.org/D44469 llvm-svn: 328078
* [mips] Add support for CRC ASEPetar Jovanovic2018-03-141-1/+2
| | | | | | | | | | | | | | | | | | | This includes Instructions: crc32b, crc32h, crc32w, crc32d, crc32cb, crc32ch, crc32cw, crc32cd Assembler directives: .set crc, .set nocrc, .module crc, .module nocrc Attribute: crc .MIPS.abiflags: CRC (0x8000) Patch by Vladimir Stefanovic. Differential Revision: https://reviews.llvm.org/D44176 llvm-svn: 327511
* [llvm-readobj] Extend the output of -elf-section-groupsAlexander Shaposhnikov2018-03-121-1/+12
| | | | | | | | | | | | | | This diff extends the output of -elf-section-groups (llvm style, gnu style is unchanged since it's meant to be compatible with binutils readelf) with sh_link and sh_info. This change will enable us to use llvm-readobj -elf-section-groups for testing llvm-objcopy's support for .group sections. Test plan: make check-all Differential revision: https://reviews.llvm.org/D44280 llvm-svn: 327341
* [llvm-readobj][ELF] Move ELF note parsing into libObjectScott Linder2018-03-121-47/+43
| | | | | | | | | Clean up the parsing of notes in llvm-readobj, improve bounds checking, and allow the parsing code to be reused. Differential Revision: https://reviews.llvm.org/D43958 llvm-svn: 327320
* Reland "[DebugInfo] Support DWARF expressions in eh_frame"Rafael Auler2018-03-081-0/+6
| | | | | | | | | | Summary: Original change was D43313 (r326932) and reverted by r326953 because it broke an LLD test and a windows build. The LLD test was already fixed in lld commit r326944 (thanks maskray). This is the original change with the windows build fixed. llvm-svn: 326970
* Revert r326932: [DebugInfo] Support DWARF expressions in eh_frameRui Ueyama2018-03-071-6/+0
| | | | | | This reverts commit rr326932 because it broke lld/test/ELF/eh-frame-hdr-augmentation.s. llvm-svn: 326953
* [DebugInfo] Support DWARF expressions in eh_frameRafael Auler2018-03-071-0/+6
| | | | | | | | | | | | | | | | | | This patch enhances DWARFDebugFrame with the capability of parsing and printing DWARF expressions in CFI instructions. It also makes FDEs and CIEs accessible to lib users, so they can process them in client tools that rely on LLVM. To make it self-contained with a test case, it teaches llvm-readobj to be able to dump EH frames and checks they are correct in a unit test. The llvm-readobj code is Maksim Panchenko's work (maksfb). Reviewers: JDevlieghere, espindola Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D43313 llvm-svn: 326932
* AMDGPU: Bring elf flags in sync with the specKonstantin Zhuravlyov2018-02-161-4/+32
| | | | | | | | | | | - Add MACH flags - Add XNACK flag - Add reserved flags - Minor cleanups in docs Differential Revision: https://reviews.llvm.org/D43356 llvm-svn: 325399
* CodeGen: support an extension to pass linker options on ELFSaleem Abdulrasool2018-01-301-0/+37
| | | | | | | | | | | | | | | | | | Introduce an extension to support passing linker options to the linker. These would be ignored by older linkers, but newer linkers which support this feature would be able to process the linker. Emit a special discarded section `.linker-option`. The content of this section is a pair of strings (key, value). The key is a type identifier for the parameter. This allows for an argument free parameter that will be processed by the linker with the value being the parameter. As an example, `lib` identifies a library to be linked against, traditionally the `-l` argument for Unix-based linkers with the parameter being the library name. Thanks to James Henderson, Cary Coutant, Rafael Espinolda, Sean Silva for the valuable discussion on the design of this feature. llvm-svn: 323783
* Instead of ELFFile<ELFT>::Type, use ELFT::Type. NFC.Rui Ueyama2018-01-121-33/+31
| | | | llvm-svn: 322346
* Use ELF{32,64}{LE,BE} instead of ELFType<{little,big}, {true,false}>. NFC.Rui Ueyama2018-01-121-4/+3
| | | | llvm-svn: 322342
* [llvm-readobj] Consistent use of ScopedPrinterSam Clegg2018-01-101-6/+5
| | | | | | | | | There were a few places where outs() was being used directly rather than the ScopedPrinter object. Differential Revision: https://reviews.llvm.org/D41370 llvm-svn: 322141
* Avoid int to string conversion in Twine or raw_ostream contexts.Benjamin Kramer2017-12-281-2/+2
| | | | | | Some output changes from uppercase hex to lowercase hex, no other functionality change intended. llvm-svn: 321526
* [llvm-readobj] Fix ambiguous call to the `printNumber`Simon Atanasyan2017-12-211-1/+1
| | | | llvm-svn: 321254
* [llvm-readobj] Support 'GNU' style for MIPS GOT/PLT dumpingSimon Atanasyan2017-12-211-261/+445
| | | | | | | | | | 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. llvm-svn: 321253
* [llvm-readobj] Remove redundant local variables to reduce the code. NFCSimon Atanasyan2017-12-021-9/+5
| | | | llvm-svn: 319617
* [llvm-readobj] Print static MIPS GOTSimon Atanasyan2017-12-021-30/+55
| | | | | | | | | | 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`. llvm-svn: 319616
* [llvm-readobj] Delete unused method argument. NFCSimon Atanasyan2017-12-021-8/+9
| | | | llvm-svn: 319615
* Add ELF dynamic symbol support to yaml2obj/obj2yamlDave Lee2017-11-161-0/+1
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 318433
* Inline compareAddr function into its only caller. NFCI.Peter Collingbourne2017-10-311-2/+5
| | | | llvm-svn: 317045
* ELF: Add support for emitting dynamic relocations in the Android relocation ↵Peter Collingbourne2017-10-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 316775
* llvm-readobj: Add support for reading relocations in the Android packed format.Peter Collingbourne2017-10-251-5/+24
| | | | | | | | | | | 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 llvm-svn: 316543
* llvm-readobj: Print AMDGPU note contentsKonstantin Zhuravlyov2017-10-141-32/+35
| | | | | | Differential Revision: https://reviews.llvm.org/D38752 llvm-svn: 315819
* llvm-readobj: Print AMDGPU note type namesKonstantin Zhuravlyov2017-10-141-2/+27
| | | | | | Differential Revision: https://reviews.llvm.org/D38751 llvm-svn: 315813
* Remove unused variables. No functionality change.Benjamin Kramer2017-10-081-1/+0
| | | | llvm-svn: 315185
* AMDGPU: Add and set AMDGPU-specific e_flagsKonstantin Zhuravlyov2017-10-051-0/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D38556 llvm-svn: 314987
* AMDGPU: Add ELFOSABI_AMDGPU_MESA3DKonstantin Zhuravlyov2017-10-031-2/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D38387 llvm-svn: 314846
* AMDGPU: Add ELFOSABI_AMDGPU_PALKonstantin Zhuravlyov2017-10-031-1/+2
| | | | llvm-svn: 314843
* [llvm-readobj][RISCV] Pretty-print RISCV e_flagsAlex Bradbury2017-10-031-0/+10
| | | | llvm-svn: 314772
OpenPOWER on IntegriCloud