summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj/ELFDumper.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Replace "fallthrough" comments with LLVM_FALLTHROUGHJustin Bogner2016-08-171-1/+1
| | | | | | | This is a mechanical change of comments in switches like fallthrough, fall-through, or fall-thru to use the LLVM_FALLTHROUGH macro instead. llvm-svn: 278902
* BPF: Use official ELF e_machine valueAlexei Starovoitov2016-07-151-0/+1
| | | | | | | | | The same value for EM_BPF is being propagated to glibc, elfutils, and binutils. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Alexei Starovoitov <ast@kernel.org> llvm-svn: 275633
* [llvm-readobj] - Teach llvm-readobj to print dependencies of SHT_GNU_verdef ↵George Rimar2016-06-221-18/+26
| | | | | | | | | | | | | | | and refactor dumping method. This patch changes single method of llvm-readobj. It teaches SHT_GNU_verdef dumper to print version dependencies, also it removes few fields from output that can be dumped with other keys and slightly refactors code. Testcase was also modified to match the changes. Change is required for testcases of upcoming lld patches. Differential revision: http://reviews.llvm.org/D21552 llvm-svn: 273417
* [llvm-readobj] - Teach llvm-readobj to dump .gnu.version_r sectionsGeorge Rimar2016-06-071-0/+55
| | | | | | | | | | SHT_GNU_verneed (.gnu.version_r) is a version dependency section. It was the last symbol versioning relative section that was not dumped, now it is. Differential revision: http://reviews.llvm.org/D21024 llvm-svn: 271998
* [llvm-readobj] - Teach readobj to recognize SHF_COMPRESSED flag.George Rimar2016-05-211-2/+10
| | | | | | | | | | | | | | | | | | | | | | | Main problem here was that SHF_COMPRESSED has the same value with XCORE_SHF_CP_SECTION, which was included as standart (common) flag. As far I understand xCore is a family of controllers and it that means it's constant should be processed separately, only if e_machine == EM_XCORE, otherwise llvm-readobj would output different constants twice for compressed section: Flags [ .. SHF_COMPRESSED (0x800) .. XCORE_SHF_CP_SECTION (0x800) .. ] what probably does not make sence if you're not working with xcore file. Differential revision: http://reviews.llvm.org/D20273 llvm-svn: 270320
* llvm-readobj: Fix GNU style entry point print widthHemant Kulkarni2016-05-121-1/+1
| | | | llvm-svn: 269376
* llvm-readobj: Change Hex output for GNU style dynamic table printHemant Kulkarni2016-05-121-3/+4
| | | | | | | Dynamic table when printed shows uppercase tag/values. This changes it to lower case when printing in GNU style llvm-svn: 269368
* llvm-readobj: Fix the GNU section header flags for SHF_MASKPROC and SHF_MASKOSHemant Kulkarni2016-05-121-2/+4
| | | | llvm-svn: 269338
* [llvm-readobj] Print MIPS .MIPS.options section contentSimon Atanasyan2016-05-041-7/+61
| | | | | | | | | .MIPS.options section specifies miscellaneous options to be applied to an object file. LLVM as well as modern versions of GNU tools emit the only type of the options - ODK_REGINFO. The patch teaches llvm-readobj to print details of the ODK_REGINFO and skip contents of other options. llvm-svn: 268478
* Move llvm-readobj/StreamWriter to Support.Zachary Turner2016-05-031-18/+16
| | | | | | | | | We wish to re-use this from llvm-pdbdump, and it provides a nice way to print structured data in scoped format that could prove useful for many other dumping tools as well. Moving to support and changing name to ScopedPrinter to better reflect its purpose. llvm-svn: 268342
* [llvm-readobj] Dump hash as part of -version-info.Davide Italiano2016-05-021-0/+1
| | | | llvm-svn: 268210
* [llvm-readobj] Add ELF hash histogram printingHemant Kulkarni2016-04-111-0/+121
| | | | | | Differential Revision: http://reviews.llvm.org/D18907 llvm-svn: 265967
* Use ArrayRef for contiguous areas in ELF. NFC.Rafael Espindola2016-04-051-9/+9
| | | | | | This just simplifies the code a bit. More so in lld. llvm-svn: 265403
* [llvm-readobj] NFC: Remove unneeded parenthesisHemant Kulkarni2016-03-291-6/+6
| | | | llvm-svn: 264731
* [llvm-readobj] Support GNU style dyn-relocationsHemant Kulkarni2016-03-291-20/+108
| | | | | | http://reviews.llvm.org/D18534 llvm-svn: 264693
* [llvm-readobj] NFC Replace case by macros for PT_* enumsHemant Kulkarni2016-03-281-24/+16
| | | | llvm-svn: 264595
* Fix Narrowing conversion warning introduced by r264415Hemant Kulkarni2016-03-251-1/+1
| | | | llvm-svn: 264419
* [llvm-readobj] Impl GNU style program headers printHemant Kulkarni2016-03-251-20/+226
| | | | | | | | readelf -lW Differential Revision: http://reviews.llvm.org/D18372 llvm-svn: 264415
* [llvm-readobj] Decode st_other symbol's flagsSimon Atanasyan2016-03-241-1/+41
| | | | | | | | | The patch supports common STV_xxx visibility flags and MIPS specific STO_MIPS_xxx flags. Differential Revision: http://reviews.llvm.org/D18447 llvm-svn: 264300
* [llvm-readobj] Impl GNU style symbols printingHemant Kulkarni2016-03-211-40/+174
| | | | | | | | Implements "readelf -sW and readelf -DsW" Differential Revision: http://reviews.llvm.org/D18224 llvm-svn: 263952
* [llvm-readobj] Impl GNU style printing of sections and relocationsHemant Kulkarni2016-03-151-261/+639
| | | | | | Differential Revision: http://reviews.llvm.org/D17523 llvm-svn: 263561
* [llvm-readobj] Enable GNU style section group printHemant Kulkarni2016-03-091-34/+87
| | | | | | Differential Revision: http://reviews.llvm.org/D17822 llvm-svn: 263050
* [lanai] Add ELF enum value and relocations.Jacques Pienaar2016-03-011-1/+2
| | | | | | | | | | Add ELF enum value and relocations for Lanai backed. General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend" (http://lists.llvm.org/pipermail/llvm-dev/2016-February/095118.html). Differential Revision: http://reviews.llvm.org/D17008 llvm-svn: 262394
* Reverts change r261907 and r261918Hemant Kulkarni2016-02-251-674/+265
| | | | llvm-svn: 261927
* [llvm-readobj] Enable GNU style sections and relocations printingHemant Kulkarni2016-02-251-265/+674
| | | | | | http://reviews.llvm.org/D17523 llvm-svn: 261907
* [readobj] Remove uneeded braces in case statement.Michael J. Spencer2016-02-171-2/+1
| | | | llvm-svn: 261170
* Represent the dynamic table itself with a DynRegionInfo.Rafael Espindola2016-02-171-12/+17
| | | | | | | | | | | | The dynamic table is also an array of a fixed structure, so it can be represented with a DynReginoInfo. No major functionality change. The extra error checking is covered by existing tests with a broken dynamic program header. Idea extracted from r260488. I did the extra cleanups. llvm-svn: 261107
* Add a unwrapOrError utility and use it to simplify ELFDumper.cpp.Rafael Espindola2016-02-171-119/+71
| | | | | | Utility extracted from r260488. llvm-svn: 261103
* Change how readobj stores info about dynamic symbols.Rafael Espindola2016-02-171-44/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to keep both a section and a pointer to the first symbol. The oddity of keeping a section for dynamic symbols is because there is a DT_SYMTAB but no DT_SYMTABZ, so to print the table we have to find the size via a section table. The reason for still keeping a pointer to the first symbol is because we want to be able to print relocation tables even if the section table is missing (it is mandatory only for files used in linking). With this patch we keep just a DynRegionInfo. This then requires changing a few places that were asking for a Elf_Shdr but actually just needed the first symbol. The test change is to delete the program header pointer. Now that we use the information of both DT_SYMTAB and .dynsym, we don't depend on the sh_entsize of .dynsym if we see DT_SYMTAB. Note: It is questionable if it is worth it putting the effort to report broken sh_entsize given that in files with no section table we have to assume it is sizeof(Elf_Sym), but that is for another change. Extracted from r260488. llvm-svn: 261099
* Reapply r260489.Rafael Espindola2016-02-161-0/+29
| | | | | | | | | | Original commit message: [readobj] Dump DT_JMPREL relocations when outputting dynamic relocations. The bits of r260488 it depends on have been committed. llvm-svn: 260970
* Introduce a getAsRange helper.Rafael Espindola2016-02-161-25/+9
| | | | | | | | | This requires making an error message a bit more generic, but that seems a reasonable tradeoff. Extracted from r260488 but simplified a bit. llvm-svn: 260967
* Move DynRegionInfo out of the ELFDumper.Rafael Espindola2016-02-161-11/+11
| | | | | | | | This reduces indentation in preparation to adding a bit more code to it. Extracted from r260488. llvm-svn: 260963
* This reverts commit r260488 and r260489.Rafael Espindola2016-02-161-181/+98
| | | | | | | | | | | Original messages: Revert "[readobj] Handle ELF files with no section table or with no program headers." Revert "[readobj] Dump DT_JMPREL relocations when outputting dynamic relocations." r260489 depends on r260488 and among other issues r260488 deleted error handling code. llvm-svn: 260962
* [readobj] Dump DT_JMPREL relocations when outputting dynamic relocations.Michael J. Spencer2016-02-111-0/+28
| | | | llvm-svn: 260489
* [readobj] Handle ELF files with no section table or with no program headers.Michael J. Spencer2016-02-111-98/+153
| | | | | | | | This adds support for finding the dynamic table and dynamic symbol table via the section table or the program header table. If there's no section table an attempt is made to figure out the length of the dynamic symbol table. llvm-svn: 260488
* [readobj] Move dynamic table parsing to a new function. NFC.Michael J. Spencer2016-02-111-5/+14
| | | | llvm-svn: 260487
* [readobj] Sort switch by enum value.Michael J. Spencer2016-02-111-29/+29
| | | | | | | Sort by enum value, but keep related entries adjacent. This makes it easier to compare against documentation. llvm-svn: 260486
* [readobj] Parse sections before dynamic table.Michael J. Spencer2016-02-111-36/+36
| | | | | | | NFC. This code will be expanded to handle dynamic tables that don't have a PT_DYNAMIC. llvm-svn: 260485
* Fix const confusion while lambda function usageHemant Kulkarni2016-02-111-24/+26
| | | | llvm-svn: 260484
* Fix build failure caused in r260430Hemant Kulkarni2016-02-111-1/+1
| | | | llvm-svn: 260471
* [llvm-readobj] Option to emit readelf like outputHemant Kulkarni2016-02-101-260/+370
| | | | | | | | | New option --elf-output-style=LLVM or GNU Enables -file-headers in readelf style when elf-output-style=GNU Differential revision: http://reviews.llvm.org/D14128 llvm-svn: 260430
* Revert "[llvm-readobj] Option to emit readelf like output"Hemant Kulkarni2016-02-101-369/+260
| | | | | | This reverts commit a58765909660a7195b32e0cc8c7476168b913750. llvm-svn: 260397
* [llvm-readobj] Option to emit readelf like outputHemant Kulkarni2016-02-101-260/+369
| | | | | | | | | New option --elf-output-style=LLVM or GNU Enables -file-headers in readelf style when elf-output-style=GNU Differential revision: http://reviews.llvm.org/D14128 llvm-svn: 260391
* [llvm-readobj][ELF] Show MIPS GOT content when there is another zero-sized ↵Simon Atanasyan2016-02-091-40/+25
| | | | | | | | | | | | | section at the same address It is possible to have .got section and one or more zero-sized section at the same address. This patch first checks that GOT (or GOT PLT) section should have non-zero size using corresponding dynamic tags. Then it looks up not empty section at the specified address. Differential Revision: http://reviews.llvm.org/D16968 llvm-svn: 260245
* Remove superfluous call to std::to_string that's breaking the cygwin build.Benjamin Kramer2016-01-271-2/+1
| | | | llvm-svn: 258928
* Fix comparison warning (r258845)Hemant Kulkarni2016-01-261-1/+1
| | | | llvm-svn: 258856
* Fixes build break introduced by r258845Hemant Kulkarni2016-01-261-1/+1
| | | | llvm-svn: 258854
* [llvm-readobj] Add -elf-section-groups optionHemant Kulkarni2016-01-261-0/+46
| | | | | | | | | Adds a way to inspect SHT_GROUP sections in ELF objects. Displays signature, member sections of these sections. Differential revision: http://reviews.llvm.org/D16555 llvm-svn: 258845
* [llvm-readobj][ELF] Teach llvm-readobj to show arch specific ELF section's flagsSimon Atanasyan2016-01-201-2/+47
| | | | | | | | | | | | | | Some architecture specific ELF section flags might have the same value (for example SHF_X86_64_LARGE and SHF_HEX_GPREL) and we have to check machine architectures to select an appropriate set of possible flags. The patch selects architecture specific flags into separate arrays `ElfxxxSectionFlags` and combines `ElfSectionFlags` and `ElfxxxSectionFlags` before pass to the `StreamWriter::printFlags()` method. Differential Revision: http://reviews.llvm.org/D16269 llvm-svn: 258334
* [llvm-readobj][ELF] s/dyn_rela_/dyn_rel_/ No functional changes.Simon Atanasyan2016-01-181-16/+16
| | | | | | | Follow up to r258001. These template functions might return both REL and RELA relocations. The 'rel' noun looks less ambiguous. llvm-svn: 258060
OpenPOWER on IntegriCloud