summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-readobj
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-readobj] Install llvm-readelf aliasPetr Hosek2017-07-191-0/+2
| | | | | | | | | | | Install an llvm-readelf symlink to llvm-readobj. When invoked as *readelf*, default to -elf-output-style=GNU. Patch by Roland McGrath Differential Revision: https://reviews.llvm.org/D33869 llvm-svn: 308408
* [llvm-readobj] Accept (and ignore) --wide (-W) command-line switchPetr Hosek2017-07-181-0/+6
| | | | | | | | | | | | | Accept and ignore --wide/-W. In GNU readelf this switch is necessary to get the output format that's consistent between 32-bit and 64-bit targets. llvm-readobj always produces that output format. Patch by Roland McGrath Differential Revision: https://reviews.llvm.org/D33873 llvm-svn: 308396
* [llvm-readobj] Accept -S as an alias for --sectionsPetr Hosek2017-07-181-1/+1
| | | | | | | | | | | | | | | In GNU readelf, the short option for --sections is upper-case -S. Note that GNU uses lower-case -s to mean --symbols, while LLVM uses -s to mean --sections and -t to mean --symbols (-t has yet a different meaning in GNU). So command-line uses with -S can now be compatible, but uses with -s or -t are still incompatible. Patch by Roland McGrath Differential Revision: https://reviews.llvm.org/D33872 llvm-svn: 308392
* [llvm-readobj] - Teach readobj to print DT_FILTER dynamic tag in human ↵George Rimar2017-07-143-21/+22
| | | | | | | | | | | 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
* [codeview] Change readobj symbol dumping formatReid Kleckner2017-07-111-10/+10
| | | | | | | | Avoid duplicating DictScope with hand-written names everywhere. Print the S_-prefixed symbol kind for every record. This should make it easier to search for certain kinds of records when debugging PDB linking. llvm-svn: 307732
* [WebAssembly] Add more details to llvm-readobj for wasm filesSam Clegg2017-07-101-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D35208 llvm-svn: 307588
* [WebAssembly] Be consistent in generating trivial test input filesSam Clegg2017-07-106-82/+101
| | | | | | | | | | | | | For each checked-in wasm file, make sure the there is corresponding .ll file that can be used to regenerate it if needed. Add test/Object/Inputs/trivial-object-test.wasm to match other formats and add some new wasm tests in test/Object. Differential Revision: https://reviews.llvm.org/D35213 llvm-svn: 307585
* [llvm-readobj] Improve printouts for COFF ARM64 binariesMartin Storsjo2017-06-302-0/+17
| | | | | | Differential Revision: https://reviews.llvm.org/D34835 llvm-svn: 306795
* [llvm-readobj] Include the PE magic value in printoutsMartin Storsjo2017-06-302-0/+2
| | | | | | | | This is useful for a testcase in lld. Differential Revision: https://reviews.llvm.org/D34836 llvm-svn: 306794
* [WebAssembly] Add more support for weak symbolsSam Clegg2017-06-261-0/+4
| | | | | | | | | Add weak symbol tests to MC Add symbol flags to output of `llvm-readobj -t`. Differential Revision: https://reviews.llvm.org/D34635 llvm-svn: 306330
* [llvm-readobj] Fix COFF RVA table dumping bugReid Kleckner2017-06-232-0/+6
| | | | | | | | We would return an error in getVaPtr if the RVA table being dumped was the last data in the .rdata section. Avoid the issue by subtracting one from the offset and adding it back to get an open interval again. llvm-svn: 306171
* [llvm-readobj] Dump the COFF image load configReid Kleckner2017-06-223-0/+87
| | | | | | | | This includes the safe SEH tables and the control flow guard function table. LLD will emit the guard table soon, and I need a tool that dumps them for testing. llvm-svn: 305979
* Update the test framework for llvm-cvtres to be more comprehensive.Eric Beckmann2017-06-131-99/+131
| | | | | | | | | | Summary: Added test cases for multiple machine types, file merging, multiple languages, and more resource types. Also fixed new bugs these tests exposed. Subscribers: javed.absar, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D34047 llvm-svn: 305258
* Revert "Fix alignment bug in COFF emission."Eric Beckmann2017-06-131-131/+99
| | | | | | | | | I accidentally combined this patch with one for adding more tests, they should be separated. This reverts commit 3da218a523be78df32e637d3446ecf97c9ea0465. llvm-svn: 305257
* Fix alignment bug in COFF emission.Eric Beckmann2017-06-131-99/+131
| | | | | | | | | | | | Summary: Fix alignment issue in D34020, by aligning all sections to 8 bytes. Reviewers: zturner Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D34072 llvm-svn: 305256
* AMDGPU: Remove deprecated and unused elf definitionsKonstantin Zhuravlyov2017-06-055-54/+14
| | | | | | Differential Revision: https://reviews.llvm.org/D33689 llvm-svn: 304737
* [llvm-readobj] Improve errors on invalid binarySam Clegg2017-05-101-0/+7
| | | | | | | | | | | | | | The previous code was discarding the error message from createBinary() by calling errorToErrorCode(). This meant that such error were always reported unhelpfully as "Invalid data was encountered while parsing the file". Other tools such as llvm-objdump already produce a more the error message in this case. Differential Revision: https://reviews.llvm.org/D32985 llvm-svn: 302664
* Quick fix to D32609, it seems .o files are not transferred in all cases.Eric Beckmann2017-05-082-1/+1
| | | | | | Therefore the .o file in question is renamed to .obj.coff. llvm-svn: 302400
* Update llvm-readobj -coff-resources to display tree structure.Eric Beckmann2017-05-085-18/+154
| | | | | | | | | | | | Summary: Continue making updates to llvm-readobj to display resource sections. This is necessary for testing the up and coming cvtres tool. Reviewers: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32609 llvm-svn: 302399
* Revert "Hopefully one last commit to fix this patch, addresses string reference"Eric Beckmann2017-05-086-154/+18
| | | | | | | | | | | | | | | | | | | | | Summary: This reverts commit 56beec1b1cfc6d263e5eddb7efff06117c0724d2. Revert "Quick fix to D32609, it seems .o files are not transferred in all cases." This reverts commit 7652eecd29cfdeeab7f76f687586607a99ff4e36. Revert "Update llvm-readobj -coff-resources to display tree structure." This reverts commit 422b62c4d302cfc92401418c2acd165056081ed7. Reviewers: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32958 llvm-svn: 302397
* Quick fix to D32609, it seems .o files are not transferred in all cases.Eric Beckmann2017-05-072-1/+1
| | | | | | Therefore the .o file in question is renamed to .obj.coff. llvm-svn: 302388
* Update llvm-readobj -coff-resources to display tree structure.Eric Beckmann2017-05-075-18/+154
| | | | | | | | | | | | Summary: Continue making updates to llvm-readobj to display resource sections. This is necessary for testing the up and coming cvtres tool. Reviewers: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32609 llvm-svn: 302386
* [AArch64] ILP32 Backend Relocation SupportJoel Jones2017-05-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 and TLSDESC_ADD_LO12 relocations Rearrange ordering in AArch64.def to follow relocation encoding Fix name: R_AARCH64_P32_LD64_GOT_LO12_NC => R_AARCH64_P32_LD32_GOT_LO12_NC Add support for several "TLS", "TLSGD", and "TLSLD" relocations for ILP32 Fix return values from isNonILP32reloc Add implementations for R_AARCH64_ADR_PREL_PG_HI21_NC, R_AARCH64_P32_LD32_GOT_LO12_NC, R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC, R_AARCH64_P32_TLSDESC_LD32_LO12, R_AARCH64_LD64_GOT_LO12_NC, *TLSLD_LDST128_DTPREL_LO12, *TLSLD_LDST128_DTPREL_LO12_NC, *TLSLE_LDST128_TPREL_LO12, *TLSLE_LDST128_TPREL_LO12_NC Modify error messages to give name of equivalent relocation in the ABI not being used, along with better checking for non-existent requested relocations. Added assembler support for "pg_hi21_nc" Relocation definitions added without implementations: R_AARCH64_P32_TLSDESC_ADR_PREL21, R_AARCH64_P32_TLSGD_ADR_PREL21, R_AARCH64_P32_TLSGD_ADD_LO12_NC, R_AARCH64_P32_TLSLD_ADR_PREL21, R_AARCH64_P32_TLSLD_ADR_PAGE21, R_AARCH64_P32_TLSLD_ADD_LO12_NC, R_AARCH64_P32_TLSLD_LD_PREL19, R_AARCH64_P32_TLSDESC_LD_PREL19, R_AARCH64_P32_TLSGD_ADR_PAGE21, R_AARCH64_P32_TLS_DTPREL, R_AARCH64_P32_TLS_DTPMOD, R_AARCH64_P32_TLS_TPREL, R_AARCH64_P32_TLSDESC Fix encoding: R_AARCH64_P32_TLSDESC_ADR_PAGE21 Reviewers: Peter Smith Patch by: Joel Jones (jjones@cavium.com) Differential Revision: https://reviews.llvm.org/D32072 llvm-svn: 301980
* Revert "Remove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 and"Zachary Turner2017-05-021-2/+2
| | | | | | | | This reverts commit c08155afc5d3230792da2ad30a046a8617735a73. This is causing undefined symbol errors with some of the constants. llvm-svn: 301944
* Remove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 andJoel Jones2017-05-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TLSDESC_ADD_LO12 relocations Rearrange ordering in AArch64.def to follow relocation encoding Fix name: R_AARCH64_P32_LD64_GOT_LO12_NC => R_AARCH64_P32_LD32_GOT_LO12_NC Add support for several "TLS", "TLSGD", and "TLSLD" relocations for ILP32 Fix return values from isNonILP32reloc Add implementations for R_AARCH64_ADR_PREL_PG_HI21_NC, R_AARCH64_P32_LD32_GOT_LO12_NC, R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC, R_AARCH64_P32_TLSDESC_LD32_LO12, R_AARCH64_LD64_GOT_LO12_NC, *TLSLD_LDST128_DTPREL_LO12, *TLSLD_LDST128_DTPREL_LO12_NC, *TLSLE_LDST128_TPREL_LO12, *TLSLE_LDST128_TPREL_LO12_NC Modify error messages to give name of equivalent relocation in the ABI not being used, along with better checking for non-existent requested relocations. Added assembler support for "pg_hi21_nc" Relocation definitions added without implementations: R_AARCH64_P32_TLSDESC_ADR_PREL21, R_AARCH64_P32_TLSGD_ADR_PREL21, R_AARCH64_P32_TLSGD_ADD_LO12_NC, R_AARCH64_P32_TLSLD_ADR_PREL21, R_AARCH64_P32_TLSLD_ADR_PAGE21, R_AARCH64_P32_TLSLD_ADD_LO12_NC, R_AARCH64_P32_TLSLD_LD_PREL19, R_AARCH64_P32_TLSDESC_LD_PREL19, R_AARCH64_P32_TLSGD_ADR_PAGE21, R_AARCH64_P32_TLS_DTPREL, R_AARCH64_P32_TLS_DTPMOD, R_AARCH64_P32_TLS_TPREL, R_AARCH64_P32_TLSDESC Fix encoding: R_AARCH64_P32_TLSDESC_ADR_PAGE21 Reviewers: Peter Smith Patch by: Joel Jones (jjones@cavium.com) Differential Revision: https://reviews.llvm.org/D32072 llvm-svn: 301939
* [WebAssembly] Write initial memory in pages not bytesSam Clegg2017-04-281-0/+5
| | | | | | | | Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32660 llvm-svn: 301687
* COFF Import: expose both symbolsSaleem Abdulrasool2017-04-282-0/+7
| | | | | | | | | COFF Import libraries which use the obsolete CONSTANT export are supposed to get two symbols, one with the `_imp_` prefix and one without. Ensure that we expose both for iteration. This is necessary to fix the librarian with COFF CONSTANT exports. llvm-svn: 301614
* [WebAssembly] Add some tests for wasm MC layerSam Clegg2017-04-281-3/+2
| | | | | | | | Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32558 llvm-svn: 301606
* [llvm-readobj] Dump COFF Resources section.Zachary Turner2017-04-271-0/+19
| | | | | | | | | | | | This patch dumps the raw bytes of the .rsrc sections that are present in COFF object and executable files. Subsequent patches will parse this information and dump in a more human readable format. Differential Revision: https://reviews.llvm.org/D32463 Patch By: Eric Beckmann llvm-svn: 301578
* [WebAssembly] Improve readobj and nm support for wasmSam Clegg2017-04-145-46/+102
| | | | | | | | | Now that the libObect support for wasm is better we can have readobj and nm produce more useful output too. Differential Revision: https://reviews.llvm.org/D31514 llvm-svn: 300365
* [codeview] Cope with unsorted streams in type mergingReid Kleckner2017-04-034-0/+59
| | | | | | | | | | | | | | | Summary: MASM can produce type streams that are not topologically sorted. It can even produce type streams with circular references, but those are not common in practice. Reviewers: inglorion, ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31629 llvm-svn: 299403
* [codeview] Add support for label type recordsReid Kleckner2017-04-032-0/+16
| | | | | | MASM can produce these type records. llvm-svn: 299388
* [WebAssembly] Improve support for WebAssembly binary formatDerek Schuff2017-03-302-1/+1
| | | | | | | | | | | | | | | | | | | Mostly this change adds support converting to and from YAML which will allow us to write more test cases for the WebAssembly MC and lld ports. Better support for objdump, readelf, and nm will be in followup CLs. I had to update the two wasm test binaries because they used the old style 'name' section which is no longer supported. Differential Revision: https://reviews.llvm.org/D31099 Patch by Sam Clegg llvm-svn: 299101
* [codeview] Fix buggy BeginIndexMapSize assertionReid Kleckner2017-03-292-0/+29
| | | | | | | | | | | This assert is just trying to test that processing each record adds exactly one entry to the index map. The assert logic was wrong when the first record in the type stream was a field list. I've simplified the code by moving the LF_FIELDLIST-specific logic into the callback for that record type. llvm-svn: 299035
* [PDB] Split item and type records when merging type streamsReid Kleckner2017-03-241-4/+52
| | | | | | | | | | | | Summary: MSVC does this when producing a PDB. Reviewers: ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31316 llvm-svn: 298717
* [WebAssembly] Update llvm-readobj tests for switch to version 0x1Derek Schuff2017-02-222-1/+1
| | | | llvm-svn: 295875
* [WebAssembly] Add wasm support for llvm-readobjDerek Schuff2017-01-303-0/+57
| | | | | | | | | | | Create a WasmDumper subclass of ObjDumper to support Webassembly binary files. Patch by Sam Clegg Differential Revision: https://reviews.llvm.org/D27355 llvm-svn: 293569
* [llvm-readobj] - Teach readobj to print PT_OPENBSD_BOOTDATA headerGeorge Rimar2016-12-061-1/+15
| | | | | | | | | | | | | 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-0/+28
| | | | | | | -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
* AArch64 ILP32 relocations for assembly and ELFJoel Jones2016-10-242-0/+91
| | | | | | | | | | | | | | | | | | | Summary: Add relocations for AArch64 ILP32. Includes: - Addition of definitions for R_AARCH32_* - Definition of new -target-abi: ilp32 - Definition of data layout string - Tests for added relocations. Not comprehensive, but matches existing tests for 64-bit. Renames "CHECK-OBJ" to "CHECK-OBJ-LP64". - Tests for llvm-readobj Reviewers: zatrazz, peter.smith, echristo, t.p.northover Subscribers: aemerson, rengolin, mehdi_amini Differential Revision: https://reviews.llvm.org/D25159 llvm-svn: 284973
* [llvm-readobj] - Teach readobj to print ↵George Rimar2016-10-181-0/+35
| | | | | | | | | | | | | | | | | | | | 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
* COFF: Fix short import lib import name type bitshiftMartell Malone2016-10-012-0/+4
| | | | | | | | | | | | | | As per the PE COFF spec (section 8.3, Import Name Type) Offset: 18 Size 2 bits Name: Type Offset: 20 Size 3 bits Name: Name Type Offset: 20 added based on 18+2 Partially commited as rL279069 Differential Revision: https://reviews.llvm.org/D23540 llvm-svn: 283055
* [llvm-readobj] - Teach readobj to print DT_AUXILIARY dynamic tag in human ↵George Rimar2016-09-023-0/+38
| | | | | | | | | | readable form. Previously DT_AUXILIARY was unknown, patch fixes that. Differential revision: https://reviews.llvm.org/D24138 llvm-svn: 280471
* Revert "ELFDumper: Unversioned symbols must not have trailing @"Hemant Kulkarni2016-08-302-13/+13
| | | | | | | | This reverts commit 8df7a877949e8782a3a28e3ecdb0770c1e444056. Fixing other repositories and adding changes together. llvm-svn: 280152
* ELFDumper: Unversioned symbols must not have trailing @Hemant Kulkarni2016-08-302-13/+13
| | | | llvm-svn: 280140
* llvm-readobj: add support for printing GNU NotesSaleem Abdulrasool2016-08-301-0/+76
| | | | | | | | | 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
* llvm-readobj: handle import libraries with -coff-exportsSaleem Abdulrasool2016-08-182-0/+22
| | | | | | | | `link -dump -exports` lists exported symbols from import libraries as well as normal dlls. Ensure that we can handle import libraries as well in llvm-readobj. llvm-svn: 279069
* [lanai] Update ELF number to correspond to the assigned number.Jacques Pienaar2016-06-283-1/+1
| | | | | | Change EM_LANAI to correspond to machine number assigned by Xinuos. llvm-svn: 274042
* [yaml2obj] Remove --format option in favor of YAML tagsChris Bieneman2016-06-273-8/+10
| | | | | | | | | | | | | | | | | | | | | | Summary: Our YAML library's handling of tags isn't perfect, but it is good enough to get rid of the need for the --format argument to yaml2obj. This patch does exactly that. Instead of requiring --format, it infers the format based on the tags found in the object file. The supported tags are: !ELF !COFF !mach-o !fat-mach-o I have a corresponding patch that is quite large that fixes up all the in-tree test cases. Reviewers: rafael, Bigcheese, compnerd, silvas Subscribers: compnerd, llvm-commits Differential Revision: http://reviews.llvm.org/D21711 llvm-svn: 273915
* [llvm-readobj] - Teach llvm-readobj to print dependencies of SHT_GNU_verdef ↵George Rimar2016-06-221-34/+23
| | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud