summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj/ELFDumper.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Replace a report_fatal_error with an ErrorOr.Rafael Espindola2016-11-031-5/+5
| | | | llvm-svn: 285942
* Delete some dead code and add a missing "0x" prefix to a hex string inChandler Carruth2016-11-031-2/+1
| | | | | | | | | | | llvm-readobj. Another bug caught by PVS-Studio. It'd be nice to actually have a test for this, but I found it by inspection from PVS-Studio. llvm-svn: 285937
* Move a free function out of ELFFile.Rafael Espindola2016-11-031-8/+8
| | | | llvm-svn: 285920
* replace a report_fatal_error with a ErrorOr.Rafael Espindola2016-11-031-4/+4
| | | | llvm-svn: 285910
* Replace a report_fatal_error with an ErrorOr.Rafael Espindola2016-11-031-3/+4
| | | | llvm-svn: 285905
* Avoid a report_fatal_error in sections().Rafael Espindola2016-11-021-13/+13
| | | | | | | Have it return a ErrorOr<Range> and delete section_begin and section_end. llvm-svn: 285807
* [RISCV] Add RISC-V ELF definesAlex Bradbury2016-11-011-0/+1
| | | | | | | | | | Add the necessary definitions for RISC-V ELF files, including relocs. Also make necessary trivial change to ELFYaml, llvm-objdump, and llvm-readobj in order to work with RISC-V ELFs. Differential Revision: https://reviews.llvm.org/D23557 llvm-svn: 285708
* [llvm-readobj] - Teach readobj to print ↵George Rimar2016-10-181-0/+4
| | | | | | | | | | | | | | | | | | | | PT_OPENBSD_RANDOMIZE/PT_OPENBSD_WXNEEDED headers. These are OpenBSD specific program headers and currently we support them in LLD. Description of headers (just in case) available here: http://man.openbsd.org/OpenBSD-current/man5/elf.5 OpenBSD commits were: For PT_OPENBSD_RANDOMIZE: https://github.com/openbsd/src/commit/c494713c450d98da3f2e1451ee8c7fb675a7c461 For PT_OPENBSD_WXNEEDED: https://github.com/openbsd/src/commit/2a5a8fc7e30928c2cff57cfe5fb491c90d8478ad Differential revision: https://reviews.llvm.org/D25616 llvm-svn: 284471
* Refactor to use getSectionContentsAsArray.Rafael Espindola2016-10-061-1/+1
| | | | | | This centralizes quite a bit of error checking. llvm-svn: 283454
* Refactor duplicated typedefs. NFC.Rafael Espindola2016-10-061-29/+9
| | | | llvm-svn: 283453
* Use range loop. NFC.Rafael Espindola2016-10-061-8/+8
| | | | llvm-svn: 283447
* [Stackmap] Added callsite counts to emitted function information.Sanjoy Das2016-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It was previously not possible for tools to use solely the stackmap information emitted to reconstruct the return addresses of callsites in the map, which is necessary to use the information to walk a stack. This patch adds per-function callsite counts when emitting the stackmap section in order to resolve the problem. Note that this slightly alters the stackmap format, so external tools parsing these maps will need to be updated. **Problem Details:** Records only store their offset from the beginning of the function they belong to. While these records and the functions are output in program order, it is not possible to determine where the end of one function's records are without the callsite count when processing the records to compute return addresses. Patch by Kavon Farvardin! Reviewers: atrick, ributzka, sanjoy Subscribers: nemanjai Differential Revision: https://reviews.llvm.org/D23487 llvm-svn: 281532
* [llvm-readobj] - Teach readobj to print DT_AUXILIARY dynamic tag in human ↵George Rimar2016-09-021-0/+4
| | | | | | | | | | readable form. Previously DT_AUXILIARY was unknown, patch fixes that. Differential revision: https://reviews.llvm.org/D24138 llvm-svn: 280471
* Fix the MSVC 2013 build by using Elf_Word instead of making a local typedefReid Kleckner2016-08-311-6/+4
| | | | llvm-svn: 280304
* llvm-readobj: speculative fix for MSVCSaleem Abdulrasool2016-08-301-1/+1
| | | | | | Use the typedef rather than using to type alias the typename. llvm-svn: 280158
* Revert "ELFDumper: Unversioned symbols must not have trailing @"Hemant Kulkarni2016-08-301-3/+0
| | | | | | | | This reverts commit 8df7a877949e8782a3a28e3ecdb0770c1e444056. Fixing other repositories and adding changes together. llvm-svn: 280152
* ELFDumper: Unversioned symbols must not have trailing @Hemant Kulkarni2016-08-301-0/+3
| | | | llvm-svn: 280140
* llvm-readobj: add support for printing GNU NotesSaleem Abdulrasool2016-08-301-0/+138
| | | | | | | | | Add support for printing the GNU Notes. This allows an easy way to view the build id for a binary built with the build id. Currently, this only handles the GNU notes, though it would be easy to extend for other note types (default, FreeBSD, NetBSD, etc). Only the GNU style is supported currently. llvm-svn: 280131
OpenPOWER on IntegriCloud