summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj/ELFDumper.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* Add ELFOSABI_FIRST_ARCH, ELFOSABI_LAST_ARCH and start using those in ↵Konstantin Zhuravlyov2017-10-021-10/+29
| | | | | | | | llvm-readobj Differential Revision: https://reviews.llvm.org/D38418 llvm-svn: 314717
* llvm-readobj: fix a few typos (NFC)Saleem Abdulrasool2017-09-291-3/+3
| | | | | | | | Correct the spelling of multiple in a couple of sites. Patch by Alex Langford! llvm-svn: 314485
* Update the description of AVR32 for the ELFDumperDylan McKay2017-09-271-1/+1
| | | | | | AVR32 is an unrelated architecture with 32-bit addressing. llvm-svn: 314359
* [llvm-readobj] - Teach tool to report error if some section is in multiple ↵George Rimar2017-09-161-2/+38
| | | | | | | | | | | | 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 llvm-svn: 313459
* Recommit r313234 "[llvm-readobj] - Refactor printGroupSections methods."George Rimar2017-09-141-55/+73
| | | | | | | | | | | | | | | | 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 llvm-svn: 313236
* Revert r313234 "[llvm-readobj] - Refactor printGroupSections methods."George Rimar2017-09-141-73/+55
| | | | | | It broke BB. llvm-svn: 313235
* [llvm-readobj] - Refactor printGroupSections methods.George Rimar2017-09-141-55/+73
| | | | | | | | | | | | | 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 llvm-svn: 313234
* [llvm-readobj] - Teach readobj to print DT_FILTER dynamic tag in human ↵George Rimar2017-07-141-3/+11
| | | | | | | | | | | readable form. Nothing special here, output format is similar to the format used by binutils readelf and ELF Tool Chain readelf. Differential revision: https://reviews.llvm.org/D35351 llvm-svn: 308033
* MC, Object: Reserve a section type, SHT_LLVM_ODRTAB, for the ODR table.Peter Collingbourne2017-06-141-0/+2
| | | | | | | | | | | | | | This is part of the ODR checker proposal: http://lists.llvm.org/pipermail/llvm-dev/2017-June/113820.html Per discussion on the gnu-gabi mailing list [1] the section type range 0x6fff4c00..0x6fff4cff is reserved for LLVM. [1] https://sourceware.org/ml/gnu-gabi/2017-q2/msg00030.html Differential Revision: https://reviews.llvm.org/D33978 llvm-svn: 305407
* [Support] Fix some Clang-tidy modernize-use-using and Include What You Use ↵Eugene Zelenko2017-06-091-68/+104
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 305119
* AMDGPU: Remove deprecated and unused elf definitionsKonstantin Zhuravlyov2017-06-051-29/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D33689 llvm-svn: 304737
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-05-311-0/+1
| | | | llvm-svn: 304268
* Add llvm::object::getELFSectionTypeName().Rafael Espindola2017-05-021-54/+4
| | | | | | | | | | | This is motivated by https://reviews.llvm.org/D32488 where I am trying to add printing of the section type for incompatible sections to LLD error messages. This patch allows us to use the same code in llvm-readobj and LLD instead of duplicating the function inside LLD. Patch by Alexander Richardson! llvm-svn: 301921
* [llvm-readobj] Only print the real size of the notePetr Hosek2017-04-051-6/+5
| | | | | | | | | | | | | | | | | Note payloads are padded to a multiple of 4 bytes in size, but the size of the string that should be print can be smaller e.g. the n_descsz field in gold's version note is 9, so that's the whole size of the string that should be printed. The padding is part of the format of a SHT_NOTE section or PT_NOTE segment, but it's not part of the note itself. Printing the extra null bytes may confuse some tools, e.g. when the llvm-readobj is sent to grep, it treats the output as binary because it contains a null byte. Differential Revision: https://reviews.llvm.org/D30804 llvm-svn: 299576
* AMDGPU/llvm-readobj: Rename RuntimeMDNoteType -> CodeObjectMetadataNoteType toKonstantin Zhuravlyov2017-03-311-2/+2
| | | | | | match the new metadata. NFC. llvm-svn: 299275
* [AMDGPU] Restructure code object metadata creationKonstantin Zhuravlyov2017-03-221-3/+3
| | | | | | | | | | | | | | | | | - Rename runtime metadata -> code object metadata - Make metadata not flow - Switch enums to use ScalarEnumerationTraits - Cleanup and move AMDGPUCodeObjectMetadata.h to AMDGPU/MCTargetDesc - Introduce in-memory representation for attributes - Code object metadata streamer - Create metadata for isa and printf during EmitStartOfAsmFile - Create metadata for kernel during EmitFunctionBodyStart - Finalize and emit metadata to .note during EmitEndOfAsmFile - Other minor improvements/bug fixes Differential Revision: https://reviews.llvm.org/D29948 llvm-svn: 298552
* [llvm-readobj] Support SHT_MIPS_DWARF section type flagSimon Atanasyan2017-03-101-0/+3
| | | | llvm-svn: 297448
* llvm-readobj: process FreeBSD core notesSaleem Abdulrasool2017-02-121-0/+30
| | | | | | | core files on FreeBSD have additional notes to capture state. Process those notes when dumping the notes. llvm-svn: 294909
* llvm-readobj: fix next note entry calculation and print unknown note typesKonstantin Zhuravlyov2017-02-021-1/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D29131 llvm-svn: 293964
* [AMDGPU] Bump up n_type for metadata v2Konstantin Zhuravlyov2017-01-251-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D29115 llvm-svn: 293083
* [ARM] Create objdump subtarget from build attrsSam Parker2017-01-181-1/+1
| | | | | | | | | | | Enable an ELFObjectFile to read the its arm build attributes to produce a target triple with a specific ARM architecture. llvm-objdump now uses this functionality to automatically produce a more accurate target. Differential Revision: https://reviews.llvm.org/D28769 llvm-svn: 292366
* Revert r291903 and r291898. Reason: they break check-lld on the bots.Ivan Krasin2017-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Revert [ARM] Fix ubig32_t read in ARMAttributeParser Now using support functions to read data instead of trying to perform casts. =========================================================== Revert [ARM] Enable objdump to construct triple for ARM Now that The ARMAttributeParser has been moved into the library, it has been modified so that it can parse the attributes without printing them and stores them in a map. ELFObjectFile now queries the attributes to fill out the architecture details of a provided triple for 'arm' and 'thumb' targets. llvm-objdump uses this new functionality. Subscribers: llvm-commits, samparker, aemerson, mgorny Differential Revision: https://reviews.llvm.org/D28683 llvm-svn: 291911
* [ARM] Enable objdump to construct triple for ARMSam Parker2017-01-131-1/+1
| | | | | | | | | | | | | Now that The ARMAttributeParser has been moved into the library, it has been modified so that it can parse the attributes without printing them and stores them in a map. ELFObjectFile now queries the attributes to fill out the architecture details of a provided triple for 'arm' and 'thumb' targets. llvm-objdump uses this new functionality. Differential Revision: https://reviews.llvm.org/D28281 llvm-svn: 291898
* [ARM] Moved ARMAttributeParser to SupportSam Parker2017-01-131-1/+1
| | | | | | | | | Moved ARMAttributeParser out of llvm-readobj and into the support library. Differential Revision: https://reviews.llvm.org/D28227 llvm-svn: 291896
* llvm-readobj: ELF: Make DT tags machine awareHemant Kulkarni2016-12-271-13/+24
| | | | llvm-svn: 290623
* [ARM] Implement execute-only support in CodeGenPrakhar Bahuguna2016-12-151-0/+8
| | | | | | | | | | | | | | | | | | | | This implements execute-only support for ARM code generation, which prevents the compiler from generating data accesses to code sections. The following changes are involved: * Add the CodeGen option "-arm-execute-only" to the ARM code generator. * Add the clang flag "-mexecute-only" as well as the GCC-compatible alias "-mpure-code" to enable this option. * When enabled, literal pools are replaced with MOVW/MOVT instructions, with VMOV used in addition for floating-point literals. As the MOVT instruction is required, execute-only support is only available in Thumb mode for targets supporting ARMv8-M baseline or Thumb2. * Jump tables are placed in data sections when in execute-only mode. * The execute-only text section is assigned section ID 0, and is marked as unreadable with the SHF_ARM_PURECODE flag with symbol 'y'. This also overrides selection of ELF sections for globals. llvm-svn: 289784
* Attempt to fix llvm-readobj crash on ppc64 due to r289674Yaxun Liu2016-12-151-1/+1
| | | | llvm-svn: 289777
* AMDGPU: Emit runtime metadata version 2 as YAMLYaxun Liu2016-12-141-0/+32
| | | | | | Differential Revision: https://reviews.llvm.org/D25046 llvm-svn: 289674
* [llvm-readobj] - Teach readobj to print PT_OPENBSD_BOOTDATA headerGeorge Rimar2016-12-061-0/+1
| | | | | | | | | | | | | These are OpenBSD specific program headers. OpenBSD commit: https://github.com/openbsd/src/commit/d39116912b9536bd77326260dc5c6e593fd4ee24 It is required for fixing PR31288. Differential revision: https://reviews.llvm.org/D27456 llvm-svn: 288831
* llvm-readobj: Use hash tables to print dynamic symbols.Hemant Kulkarni2016-11-231-1/+108
| | | | | | | -symbols prints both .symtab and .dynsym symbols for GNU style in ELF. -dyn-symbols prints symbols looking up through hash tables. This helps validate hash tables. llvm-svn: 287786
* Remove the last use of report_fatal_error from ELF.h.Rafael Espindola2016-11-031-6/+6
| | | | llvm-svn: 285955
* Add error handling to getEntry.Rafael Espindola2016-11-031-8/+11
| | | | | | Issue found by inspection. llvm-svn: 285951
OpenPOWER on IntegriCloud