summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump/ELFDump.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ELF] Support for PT_GNU_PROPERTY in header and toolsPeter Smith2019-12-041-0/+3
| | | | | | | | | | | | | The PT_GNU_PROPERTY is generated by a linker to describe the .note.gnu.property section. The Linux kernel uses this program header to locate the .note.gnu.property section. It is described in "The Linux gABI extension" Include support for llvm-readelf, llvm-readobj and the yaml reader and writers. Differential Revision: https://reviews.llvm.org/D70959
* [llvm-objdump] Print relocation addends in hexadecimalDavid Bozier2019-11-191-3/+6
| | | | | | | | | | | | | | Summary: Matches GNU objdump. Makes debugging easier for me as I'm working out addresses from symbol+addend, so it would be good to be calculating in a single format. Reviewers: MaskRay, grimar, jhenderson, bd1976llvm Reviewed By: jhenderson Subscribers: sdardis, jrtc27, atanasyan, rupprecht, seiya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69997
* [llvm-objdump] - Cleanup the error reporting.George Rimar2019-08-211-1/+1
| | | | | | | | | | | | | | | | | | | The error reporting function are not consistent. Before this change: * They had inconsistent naming (e.g. 'error' vs 'report_error'). * Some of them reported the object name, others - dont. * Some of them accepted the case when there was no error. (i.e. error code or Error had a success value). This patch tries to cleanup it a bit. It also renames report_error -> reportError, report_warning -> reportWarning and removes a full stop from messages. Differential revision: https://reviews.llvm.org/D66418 llvm-svn: 369515
* [llvm-objdump] errorToErrorCode+message -> toStringFangrui Song2019-04-251-4/+3
| | | | | | For test/Object/elf-invalid-phdr.test, the intended error message got lost due to errorToErrorCode(). llvm-svn: 359166
* Revert "[llvm-objdump] errorToErrorCode+message -> toString"JF Bastien2019-04-241-3/+4
| | | | | | | | Revert r359100 It breaks llvm/test/Object/elf-invalid-phdr.test llvm-svn: 359110
* [llvm-objdump] errorToErrorCode+message -> toStringFangrui Song2019-04-241-4/+3
| | | | llvm-svn: 359100
* [llvm-objdump] Wrap things in namespace llvmFangrui Song2019-04-151-9/+10
| | | | llvm-svn: 358417
* [llvm-objdump] Migrate relocation handling functions from error_code to ErrorFangrui Song2019-04-081-13/+12
| | | | llvm-svn: 357920
* [llvm-objdump] Simplify some ELF typename: ELFFile<ELFT>::Elf_xxx -> ELFT::xxxFangrui Song2019-04-071-11/+4
| | | | llvm-svn: 357857
* .Fangrui Song2019-04-071-17/+8
| | | | llvm-svn: 357856
* [llvm-objdump] Simplify Expected<T> handling with unwrapOrErrorFangrui Song2019-04-071-30/+13
| | | | llvm-svn: 357855
* [llvm-objdump] Should print unknown d_tag in hex formatXing GUO2019-03-021-9/+2
| | | | | | | | | | | | | | | | | | Summary: Currently, `llvm-objdump` prints "unknown" instead of d_tag value in hex format. Because getDynamicTagAsString returns "unknown" rather than empty string. Reviewers: grimar, jhenderson Reviewed By: jhenderson Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58763 llvm-svn: 355262
* [llvm-objdump] Should print strings when dumping DT_RPATH, DT_RUNPATH, ↵Xing GUO2019-02-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DT_SONAME, DT_AUXILIARY and DT_FILTER tags in dynamic section. Summary: Before: ``` Dynamic Section: NEEDED libpthread.so.0 ... NEEDED ld-linux-x86-64.so.2 RPATH 0x00000000001c2e61 ``` After: ``` Dynamic Section: NEEDED libpthread.so.0 ... NEEDED ld-linux-x86-64.so.2 RPATH $ORIGIN/../lib ``` Only a small problem here, I have no idea on choosing test case. I see there's a test file(test/tools/llvm-objdump/private-headers-dynamic-section.test). But it has no DT_RPATH and DT_RUNPATH tags. Shall I replace the ELF file in the Inputs dir by a new one? Reviewers: jhenderson, grimar Reviewed By: jhenderson Subscribers: srhines, rupprecht, jfb, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58707 llvm-svn: 355001
* [llvm-objdump] Add `Version Definitions` dumperXing GUO2019-02-261-3/+44
| | | | | | | | | | | | | | | | Summary: `llvm-objdump` needs a `Version Definitions` dumper. Reviewers: grimar, jhenderson Reviewed By: grimar, jhenderson Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58615 llvm-svn: 354871
* [llvm-objdump] Add `Version References` dumperXing GUO2019-02-251-0/+70
| | | | | | | | | | | | | | | | Summary: Add symbol version dumper for [#30241](https://bugs.llvm.org/show_bug.cgi?id=30241) Reviewers: jhenderson, MaskRay, kristina, emaste, grimar Reviewed By: jhenderson, grimar Subscribers: grimar, rupprecht, jakehehrlich, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D54697 llvm-svn: 354782
* [llvm-objdump] - Print LMAs when dumping section headers.George Rimar2019-01-281-0/+29
| | | | | | | | | | | | When --section-headers is used, GNU objdump prints both LMA and VMA for sections. llvm-objdump does not do that what makes it's output be slightly inconsistent. Patch teaches llvm-objdump to print LMA/VMA for ELF file formats. The behavior for other formats remains unchanged. Differential revision: https://reviews.llvm.org/D57146 llvm-svn: 352366
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [llvm-objdump] - Move getRelocationValueString and dependenices out of the ↵George Rimar2019-01-181-0/+82
| | | | | | | | | | | | | | | | | | | | llvm-objdump.cpp getRelocationValueString is a dispatcher function that calls the corresponding ELF/COFF/Wasm/MachO implementations that currently live in the llvm-objdump.cpp file. These implementations better be moved to ELFDump.cpp, COFFDump.cpp and other corresponding files, to move platform specific implementation out from the common logic. The patch does that. Also, I had to move ToolSectionFilter helper and SectionFilterIterator, SectionFilter to a header to make them available across the objdump code. Differential revision: https://reviews.llvm.org/D56842 llvm-svn: 351545
* [llvm-objdump] Use `auto` declaration in typecastingXing GUO2018-11-151-16/+8
| | | | | | | | | | | | | | | | Summary: According to `MaskRay`, use `auto` for type inference, according to coding standards. Delete some comments, because these comments can be easily inferred from codes. Reviewers: jhenderson, MaskRay Reviewed By: jhenderson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54573 llvm-svn: 346946
* [llvm-objdump] Improve ELF file type checking statements (D54509)Xing GUO2018-11-141-12/+6
| | | | llvm-svn: 346851
* [llvm-objdump] Add dynamic section printing to private-headers optionPaul Semel2018-07-251-0/+89
| | | | | | Differential Revision: https://reviews.llvm.org/D49016 llvm-svn: 337902
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-011-1/+1
| | | | | | | | | | | | | | | | 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
* [llvm-objdump] Dump PT_NOTE as part of -p.Davide Italiano2017-01-161-0/+3
| | | | | PR: 31641 llvm-svn: 292170
* [llvm-objdump] Dump PT_GNU_RELRO as part of -p.Davide Italiano2017-01-161-0/+3
| | | | | PR: 31641 llvm-svn: 292169
* [llvm-objdump] Dump PT_OPENBSD_{BOOTDATA,RANDOMIZE,WXNEEDED}.Davide Italiano2017-01-161-0/+9
| | | | | PR: 31641 llvm-svn: 292167
* llvm-objdump: sort phdr type strings in advance of adding new onesEd Maste2016-12-241-7/+7
| | | | llvm-svn: 290494
* [ELF] Convert ELF.h to Expected<T>.Davide Italiano2016-11-161-2/+3
| | | | | | | | | | | | This has two advantages: 1) We slowly move away from ErrorOr to the new handling interface, in the hope of having an uniform error handling in LLVM, eventually. 2) We're starting to have *meaningful* error messages for invalid object ELF files, rather than a generic "parse error". At some point we should include also the offset to improve the quality of the diagnostic. llvm-svn: 287081
* Replace a report_fatal_error with an ErrorOr.Rafael Espindola2016-11-031-1/+4
| | | | llvm-svn: 285942
* Simplify iterating over program headers and detect corrupt ones.Rafael Espindola2015-07-201-20/+12
| | | | | | We now use a simple pointer and have range loops. llvm-svn: 242669
* Fix the name of the iterator functions to match the coding standards.Rafael Espindola2015-06-301-3/+3
| | | | llvm-svn: 241074
* [Object] Split the ELF interface into 3 parts.Michael J. Spencer2013-08-081-9/+7
| | | | | | | | * ELFTypes.h contains template magic for defining types based on endianess, size, and alignment. * ELFFile.h defines the ELFFile class which provides low level ELF specific access. * ELFObjectFile.h contains ELFObjectFile which uses ELFFile to implement the ObjectFile interface. llvm-svn: 188022
* Replace Count{Leading,Trailing}Zeros_{32,64} with count{Leading,Trailing}Zeros.Michael J. Spencer2013-05-241-1/+1
| | | | llvm-svn: 182680
* Introduce convenience typedefs for the 4 ELF object types.Rafael Espindola2013-05-091-8/+4
| | | | llvm-svn: 181509
* print TLS segmentShankar Easwaran2013-02-271-0/+3
| | | | llvm-svn: 176192
* [objdump] Add PT_PHDR.Michael J. Spencer2013-02-211-0/+3
| | | | llvm-svn: 175709
* [objdump] Print the PT_INTERP and PT_DYNAMIC correcctly.Michael J. Spencer2013-02-201-0/+6
| | | | llvm-svn: 175659
* Sort all of the includes. Several files got checked in with mis-sortedChandler Carruth2013-01-191-1/+0
| | | | | | includes. llvm-svn: 172891
* [Object][ELF] Simplify ELFObjectFile by using ELFType.Michael J. Spencer2013-01-151-12/+12
| | | | | | | | | | | | | This simplifies the usage and implementation of ELFObjectFile by using ELFType to replace: <endianness target_endianness, std::size_t max_alignment, bool is64Bits> This does complicate the base ELF types as they must now use template template parameters to partially specialize for the 32 and 64bit cases. However these are only defined once. llvm-svn: 172515
* [objdump] Use correct format specifiers and fix C++03 variadic warning.Michael J. Spencer2013-01-061-6/+8
| | | | llvm-svn: 171651
* [objdump] Add --private-headers, -p.Michael J. Spencer2013-01-061-0/+87
This currently prints the ELF program headers. llvm-svn: 171649
OpenPOWER on IntegriCloud