aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-readobj/ELFDumper.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-10-17Add a test that would have found the bug in r219829.Rafael Espindola1-1/+2
llvm-svn: 220016
2014-10-17Revert commit r219835 and r219829.Rafael Espindola1-2/+1
Revert "Correctly handle references to section symbols." Revert "Allow forward references to section symbols." Rui found a regression I am debugging. llvm-svn: 220010
2014-10-15Correctly handle references to section symbols.Rafael Espindola1-1/+2
When processing assembly like .long .text we were creating a new undefined symbol .text. GAS on the other hand would handle that as a reference to the .text section. This patch implements that by creating the section symbols earlier so that they are visible during asm parsing. The patch also updates llvm-readobj to print the symbol number in the relocation dump so that the test can differentiate between two sections with the same name. llvm-svn: 219829
2014-09-26Object: BSS/virtual sections don't have contentsDavid Majnemer1-1/+1
Users of getSectionContents shouldn't try to pass in BSS or virtual sections. In all instances, this is a bug in the code calling this routine. N.B. Some COFF implementations (like CL) will mark their BSS sections as taking space on disk. This would confuse COFFObjectFile into thinking the section is larger than the file. llvm-svn: 218549
2014-07-13[Mips] Support SHT_MIPS_ABIFLAGS section type flag in the llvm-readobj,Simon Atanasyan1-0/+1
obj2yaml and yaml2obj tools. llvm-svn: 212908
2014-07-05[llvm-readobj] Fix output of MIPS GOT without local and global entries.Simon Atanasyan1-1/+1
llvm-svn: 212374
2014-06-18[llvm-readobj] Fix member functions name style.Simon Atanasyan1-13/+13
llvm-svn: 211152
2014-06-18[llvm-readobj] Fix compile error.Simon Atanasyan1-1/+1
llvm-svn: 211151
2014-06-18[llvm-readobj][ELF] New `-mips-plt-got` command line option to outputSimon Atanasyan1-0/+217
MIPS GOT section. Patch reviewed by Rafael Espindola. llvm-svn: 211150
2014-06-13Remove 'using std::error_code' from tools.Rafael Espindola1-6/+6
llvm-svn: 210876
2014-06-13Remove all uses of 'using std::error_code' from headers.Rafael Espindola1-0/+1
llvm-svn: 210866
2014-06-10[llvm-readobj][ELF] Factor out the code retrieve ELF symbol informationSimon Atanasyan1-35/+50
(section name, section index, full name) into the separate functions. No functional changes. llvm-svn: 210509
2014-06-04[Object][ELF] Range-based loop simplification.Simon Atanasyan1-13/+10
No functional changes. llvm-svn: 210164
2014-05-20[Mips] Add more relocation types and MIPS specific e_flags constants.Simon Atanasyan1-1/+3
llvm-svn: 209201
2014-05-11[llvm-readobj] Print values of FLAGS and MIPS_FLAGS dynamic table tagsSimon Atanasyan1-1/+61
in a human readable form. llvm-svn: 208489
2014-05-01[llvm-readobj] Transform 'switch' with the only 'case' statementSimon Atanasyan1-5/+2
to 'if' statement. No functional changes, llvm-svn: 207748
2014-05-01[llvm-readobj] Add support for Mips specific ELF header e_flags.Simon Atanasyan1-1/+29
llvm-svn: 207744
2014-04-25[C++] Use 'nullptr'. Tools edition.Craig Topper1-1/+2
llvm-svn: 207176
2014-03-25Create .symtab_shndxr only when needed.Rafael Espindola1-2/+4
We need .symtab_shndxr if and only if a symbol references a section with an index >= 0xff00. The old code was trying to figure out if the section was needed ahead of time, making it a fairly dependent on the code actually writing the table. It was also somewhat conservative and would create the section in cases where it was not needed. If I remember correctly, the old structure was there so that the sections were created in the same order gas creates them. That was valuable when MC's support for ELF was new and we tested with elf-dump.py. This patch refactors the symbol table creation to another class and makes it obvious that .symtab_shndxr is really only created when we are about to output a reference to a section index >= 0xff00. While here, also improve the tests to use macros. One file is one section short of needing .symtab_shndxr, the second one has just the right number. llvm-svn: 204769
2014-03-24Teach llvm-readobj to print human friendly description of reserved sections.Rafael Espindola1-2/+22
llvm-svn: 204584
2014-03-08[C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper1-12/+12
class. llvm-svn: 203345
2014-03-06Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles1-4/+3
This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
2014-03-02Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper1-12/+12
llvm-svn: 202621
2014-01-30tools: remove unnecessary typenameSaleem Abdulrasool1-2/+2
This is acceptted by clang and gcc, but MSVC seems to balk at it. As it is unneeded, simply drop it. Fixes MSVC buildbots. llvm-svn: 200456
2014-01-30tools: add support for decoding ARM attributesSaleem Abdulrasool1-0/+44
Enhance the ARM specific parsing support in llvm-readobj to support attributes. This allows for simpler tests to validate encoding of the build attributes as specified in the ARM ELF specification. llvm-svn: 200450
2014-01-13Re-sort #include lines again, prior to moving headers around.Chandler Carruth1-2/+1
llvm-svn: 199080
2014-01-08Use getError and remove the error_code operator.Rafael Espindola1-2/+2
llvm-svn: 198799
2014-01-08llvm-readobj: add support for ARM EHABI unwind infoSaleem Abdulrasool1-0/+13
This adds some preliminary support for decoding ARM EHABI unwinding information. The major functionality that remains from complete support is bytecode translation. Each Unwind Index Table is printed out as a separate entity along with its section index, name, offset, and entries. Each entry lists the function address, and if possible, the name, of the function to which it corresponds. The encoding model, personality routine or index, and byte code is also listed. llvm-svn: 198734
2014-01-05[Mips] Add support for DT_MIPS_RLD_MAP and DT_MIPS_PLTGOT dynamicSimon Atanasyan1-0/+4
section tags to the llvm-readobj. llvm-svn: 198561
2013-11-11Add support for DT_VERxxx and DT_MIPS_xxx .dynamic section entries to theSimon Atanasyan1-0/+22
llvm-readobj. The patch reviewed by Michael Spencer. http://llvm-reviews.chandlerc.com/D2113 llvm-svn: 194421
2013-10-07[Mips] Teach llvm-readobj to print MIPS-specific ELF program headers.Simon Atanasyan1-21/+38
The patch reviewed by Michael Spencer. http://llvm-reviews.chandlerc.com/D1846 llvm-svn: 192093
2013-10-01Remove several unused variables.Rafael Espindola1-5/+0
Patch by Alp Toker. llvm-svn: 191757
2013-09-15ELF: Add support for the exclude section bit for gas compat.Benjamin Kramer1-0/+1
llvm-svn: 190769
2013-09-03Print string value for DT_RPATH and DT_RUNPATH.Joerg Sonnenberger1-0/+4
llvm-svn: 189829
2013-08-08[Object] Split the ELF interface into 3 parts.Michael J. Spencer1-173/+127
* 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
2013-07-25Remove the mblaze backend from llvm.Rafael Espindola1-3/+1
Approval in here http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064169.html llvm-svn: 187145
2013-06-05Handle relocations that don't point to symbols.Rafael Espindola1-3/+3
In ELF (as in MachO), not all relocations point to symbols. Represent this properly by using a symbol_iterator instead of a SymbolRef. Update llvm-readobj ELF's dumper to handle relocatios without symbols. llvm-svn: 183284
2013-05-09Introduce convenience typedefs for the 4 ELF object types.Rafael Espindola1-26/+16
llvm-svn: 181509
2013-05-09Change getRelocationAdditionalInfo to be ELF only.Rafael Espindola1-4/+4
It was only implemented for ELF where it collected the Addend, so this patch also renames it to getRelocationAddend. llvm-svn: 181502
2013-05-03Revert r181009.Amara Emerson1-63/+0
llvm-svn: 181079
2013-05-03Add support for reading ARM ELF build attributes.Amara Emerson1-0/+63
Build attribute sections can now be read if they exist via ELFObjectFile, and the llvm-readobj tool has been extended with an option to dump this information if requested. Regression tests are also included which exercise these features. Also update the docs with a fixed ARM ABI link and a new link to the Addenda which provides the build attributes specification. llvm-svn: 181009
2013-04-25Clarify getRelocationAddress x getRelocationOffset a bit.Rafael Espindola1-1/+5
getRelocationAddress is for dynamic libraries and executables, getRelocationOffset for relocatable objects. Mark the getRelocationAddress of COFF and MachO as not implemented yet. Add a test of ELF's. llvm-readobj -r now prints the same values as readelf -r. llvm-svn: 180259
2013-04-22llvm-readobj: Do not print NULL StringRefsNico Rieck1-3/+3
llvm-svn: 180005
2013-04-12Teach llvm-readobj to print ELF program headersNico Rieck1-5/+51
llvm-svn: 179363
2013-04-12Add -expand-relocs to llvm-readobjNico Rieck1-6/+16
This option expands shown relocations from single line to a dictionary format: Relocation { Offset: 0x4 Type: R_386_32 (1) Symbol: sym Info: 0x0 } llvm-svn: 179359
2013-04-03Implements low-level object file format specific output for COFF andEric Christopher1-0/+800
ELF with support for: - File headers - Section headers + data - Relocations - Symbols - Unwind data (only COFF/Win64) The output format follows a few rules: - Values are almost always output one per line (as elf-dump/coff-dump already do). - Many values are translated to something readable (like enum names), with the raw value in parentheses. - Hex numbers are output in uppercase, prefixed with "0x". - Flags are sorted alphabetically. - Lists and groups are always delimited. Example output: ---------- snip ---------- Sections [ Section { Index: 1 Name: .text (5) Type: SHT_PROGBITS (0x1) Flags [ (0x6) SHF_ALLOC (0x2) SHF_EXECINSTR (0x4) ] Address: 0x0 Offset: 0x40 Size: 33 Link: 0 Info: 0 AddressAlignment: 16 EntrySize: 0 Relocations [ 0x6 R_386_32 .rodata.str1.1 0x0 0xB R_386_PC32 puts 0x0 0x12 R_386_32 .rodata.str1.1 0x0 0x17 R_386_PC32 puts 0x0 ] SectionData ( 0000: 83EC04C7 04240000 0000E8FC FFFFFFC7 |.....$..........| 0010: 04240600 0000E8FC FFFFFF31 C083C404 |.$.........1....| 0020: C3 |.| ) } ] ---------- snip ---------- Relocations and symbols can be output standalone or together with the section header as displayed in the example. This feature set supports all tests in test/MC/COFF and test/MC/ELF (and I suspect all additional tests using elf-dump), making elf-dump and coff-dump deprecated. Patch by Nico Rieck! llvm-svn: 178679