summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj/llvm-readobj.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* llvm-readobj: add support to dump (COFF) directivesSaleem Abdulrasool2014-10-071-0/+7
| | | | | | | | PE/COFF has a special section (.drectve) which can be used to pass options to the linker (similar to LC_LINKER_OPTION). Add support to llvm-readobj to print the contents of the section for tests. llvm-svn: 219228
* This patch adds a new flag "-coff-imports" to llvm-readobj.Rui Ueyama2014-10-021-0/+6
| | | | | | | | | | | | | | When the flag is given, the command prints out the COFF import table. Currently only the import table directory will be printed. I'm going to make another patch to print out the imported symbols. The implementation of import directory entry iterator in COFFObjectFile.cpp was buggy. This patch fixes that too. http://reviews.llvm.org/D5569 llvm-svn: 218891
* Don't own the buffer in object::Binary.Rafael Espindola2014-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Owning the buffer is somewhat inflexible. Some Binaries have sub Binaries (like Archive) and we had to create dummy buffers just to handle that. It is also a bad fit for IRObjectFile where the Module wants to own the buffer too. Keeping this ownership would make supporting IR inside native objects particularly painful. This patch focuses in lib/Object. If something elsewhere used to own an Binary, now it also owns a MemoryBuffer. This patch introduces a few new types. * MemoryBufferRef. This is just a pair of StringRefs for the data and name. This is to MemoryBuffer as StringRef is to std::string. * OwningBinary. A combination of Binary and a MemoryBuffer. This is needed for convenience functions that take a filename and return both the buffer and the Binary using that buffer. The C api now uses OwningBinary to avoid any change in semantics. I will start a new thread to see if we want to change it and how. llvm-svn: 216002
* getLoadName is only implemented for ELF, make it ELF only.Rafael Espindola2014-08-081-1/+13
| | | | llvm-svn: 215219
* Remove some calls to std::move.Rafael Espindola2014-08-011-3/+3
| | | | | | | | | Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get a reference to it. Thanks to David Blaikie for the suggestion. llvm-svn: 214516
* Use std::unique_ptr to make the ownership explicit.Rafael Espindola2014-07-311-2/+2
| | | | llvm-svn: 214377
* [llvm-readobj][ELF] New `-mips-plt-got` command line option to outputSimon Atanasyan2014-06-181-0/+20
| | | | | | | | MIPS GOT section. Patch reviewed by Rafael Espindola. llvm-svn: 211150
* Convert the Archive API to use ErrorOr.Rafael Espindola2014-06-161-3/+3
| | | | | | | | | Now that we have c++11, even things like ErrorOr<std::unique_ptr<...>> are easy to use. No intended functionality change. llvm-svn: 211033
* Remove 'using std::error_code' from tools.Rafael Espindola2014-06-131-9/+7
| | | | llvm-svn: 210876
* Remove all uses of 'using std::error_code' from headers.Rafael Espindola2014-06-131-0/+1
| | | | llvm-svn: 210866
* Remove system_error.h.Rafael Espindola2014-06-121-1/+1
| | | | | | | This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch. llvm-svn: 210803
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-6/+5
| | | | | | | | | | 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
* tools: add support for decoding ARM attributesSaleem Abdulrasool2014-01-301-0/+9
| | | | | | | | 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
* Rename these methods to match the style guide.Rafael Espindola2014-01-211-2/+2
| | | | llvm-svn: 199751
* Return an ErrorOr<Binary *> from createBinary.Rafael Espindola2014-01-151-2/+3
| | | | | | | | I did write a version returning ErrorOr<OwningPtr<Binary> >, but it is too cumbersome to use without std::move. I will keep the patch locally and submit when we switch to c++11. llvm-svn: 199326
* Re-sort #include lines again, prior to moving headers around.Chandler Carruth2014-01-131-3/+0
| | | | llvm-svn: 199080
* Teach the llvm-readobj COFF dumper to dump debug line tables from object filesTimur Iskhodzhanov2013-12-191-0/+4
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D2425 llvm-svn: 197674
* Remove byte order mark from source file.Benjamin Kramer2013-08-091-1/+1
| | | | llvm-svn: 188066
* [Object] Split the ELF interface into 3 parts.Michael J. Spencer2013-08-081-2/+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
* Revert r181009.Amara Emerson2013-05-031-6/+0
| | | | llvm-svn: 181079
* Add support for reading ARM ELF build attributes.Amara Emerson2013-05-031-0/+6
| | | | | | | | | | | 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
* Clarify getRelocationAddress x getRelocationOffset a bit.Rafael Espindola2013-04-251-2/+2
| | | | | | | | | | 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
* Teach llvm-readobj to print ELF program headersNico Rieck2013-04-121-0/+6
| | | | llvm-svn: 179363
* Add -expand-relocs to llvm-readobjNico Rieck2013-04-121-0/+4
| | | | | | | | | | | | | | 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
* Implements low-level object file format specific output for COFF andEric Christopher2013-04-031-220/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [tools][llvm-readobj] print the name of the section when iterating the ↵Shankar Easwaran2013-03-251-12/+19
| | | | | | symbol table / dynamic symbol table llvm-svn: 177873
* [llvm-readobj] Add ELF .dynamic table dumping.Michael J. Spencer2013-02-201-0/+9
| | | | llvm-svn: 175592
* [readobj] Fix memory leak.Michael J. Spencer2013-02-081-1/+2
| | | | llvm-svn: 174687
* [objdump,readobj] Document the purpose and goals of each tool.Michael J. Spencer2013-02-051-4/+7
| | | | llvm-svn: 174439
* Use the generic dump template. Extracted from a patch by Sami Liedes.Rafael Espindola2012-12-311-53/+19
| | | | llvm-svn: 171305
* Dump sections. Extracted from a patch by Sami Liedes.Rafael Espindola2012-12-311-0/+76
| | | | llvm-svn: 171304
* Print a header above the symbols. Extracted from a patch by Sami Liedes.Rafael Espindola2012-12-311-0/+12
| | | | llvm-svn: 171302
* Check for errors. Extracted from a patch by Sami Liedes.Rafael Espindola2012-12-311-6/+12
| | | | llvm-svn: 171301
* Fix indentation. Extracted from a patch by Sami Liedes!Rafael Espindola2012-12-311-32/+32
| | | | llvm-svn: 171300
* Style fixes in llvm-readobj.cpp. Extracted from a patch by Sami Liedes!Rafael Espindola2012-12-311-28/+18
| | | | llvm-svn: 171299
* Sort the #include lines for tools/...Chandler Carruth2012-12-041-6/+6
| | | | | | | | Again, tools are trickier to pick the main module header for than library source files. I've started to follow the pattern of using LLVMContext.h when it is included as a stub for program source files. llvm-svn: 169252
* Fix uses of the C99 PRI format macros not to conflict with C++11 UDLs.Benjamin Kramer2012-03-101-3/+3
| | | | llvm-svn: 152474
* Support reading GNU symbol versions in ELFObjectFileDavid Meyer2012-03-091-10/+24
| | | | | | | | | | * Add enums and structures for GNU version information. * Implement extraction of that information on a per-symbol basis (ELFObjectFile::getSymbolVersion). * Implement a generic interface, GetELFSymbolVersion(), for getting the symbol version from the ObjectFile (hides the templating). * Have llvm-readobj print out the version, when available. * Add a test for the new feature: readobj-elf-versioning.test llvm-svn: 152436
* Fix comments for llvm-readobj, remove extraneous headersDavid Meyer2012-03-021-5/+9
| | | | llvm-svn: 151957
* [Object]David Meyer2012-03-011-0/+12
| | | | | | Add ObjectFile::getLoadName() for retrieving the soname/installname of a shared object. llvm-svn: 151845
* [Object]David Meyer2012-03-011-0/+188
* Add begin_dynamic_table() / end_dynamic_table() private interface to ELFObjectFile. * Add begin_libraries_needed() / end_libraries_needed() interface to ObjectFile, for grabbing the list of needed libraries for a shared object or dynamic executable. * Implement this new interface completely for ELF, leave stubs for COFF and MachO. * Add 'llvm-readobj' tool for dumping ObjectFile information. llvm-svn: 151785
OpenPOWER on IntegriCloud