summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-readobj
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-readobj] - Do not report invalid amount of sections.George Rimar2018-07-191-1/+2
| | | | | | | | | | | When output style is GNU and amount of sections is >= SHN_LORESERVE, llvm-readobj reports zero number of sections instead of actual value. The patch fixes that. Differential revision: https://reviews.llvm.org/D49544 llvm-svn: 337462
* [llvm-readobj] Generic -string-dump optionPaul Semel2018-07-181-0/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D49470 llvm-svn: 337408
* [llvm-readobj] - Teach tool to dump objects with >= SHN_LORESERVE of sections.George Rimar2018-07-183-0/+36
| | | | | | | | | | | | | | | | | | http://www.sco.com/developers/gabi/2003-12-17/ch4.eheader.html says that e_shnum and/or e_shstrndx may have special values if "the number of sections is greater than or equal to SHN_LORESERVE" or "the section name string table section index is greater than or equal to SHN_LORESERVE (0xff00)" Previously llvm-readobj was unable to dump such files, patch changes that. I had to add a precompiled test case because it does not seem possible to prepare a test using yaml2obj or llvm-mc (not clear how to make .shstrtab to have index >= SHN_LORESERVE). Differential revision: https://reviews.llvm.org/D49369 llvm-svn: 337360
* [llvm-readobj] Add -hex-dump (-x) optionPaul Semel2018-07-111-0/+20
| | | | | | Differential Revision: https://reviews.llvm.org/D48281 llvm-svn: 336782
* Revert "[llvm-readobj] Fix printing format"Paul Semel2018-07-011-8/+0
| | | | | | | There is a problem with the formatting on windows build. I need to investigate on this. llvm-svn: 336061
* [llvm-readobj] Fix printing formatPaul Semel2018-07-011-0/+8
| | | | | | | | | | | | We were printing every character, even those that weren't printable. It doesn't really make sense for this option. The string content was sticked to its address, added two spaces in between. Differential Revision: https://reviews.llvm.org/D48271 llvm-svn: 336058
* [llvm-readobj] Add experimental support for SHT_RELR sectionsJake Ehrlich2018-06-283-0/+182
| | | | | | | | | | | | | | | This change adds experimental support for SHT_RELR sections, proposed here: https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg Definitions for the new ELF section type and dynamic array tags, as well as the encoding used in the new section are all under discussion and are subject to change. Use with caution! Author: rahulchaudhry Differential Revision: https://reviews.llvm.org/D47919 llvm-svn: 335922
* llvm-readobj: fix printing number of relocations in Android packed format.Peter Collingbourne2018-06-071-0/+2
| | | | | | | | | | | | | With '-elf-output-style=GNU -relocations', a header containing the number of entries is printed before all the relocation entries in the section. For Android packed format, we need to perform the unpacking first before we can get the actual number of relocations in the section. Patch by Rahul Chaudhry! Differential Revision: https://reviews.llvm.org/D47800 llvm-svn: 334147
* [llvm-readobj] Support GNU_PROPERTY_X86_FEATURE_1_AND notes in ↵Alexander Ivchenko2018-06-041-3/+36
| | | | | | | | | | | | | | | | | .note.gnu.property Resubmit of r333424. This version contains the fix for fails found by buildbots on some targets. This patch allows parsing GNU_PROPERTY_X86_FEATURE_1_AND notes in .note.gnu.property sections. These notes indicate that the object file is built to support Intel CET. patch by mike.dvoretsky Differential Revision: https://reviews.llvm.org/D47473 llvm-svn: 333908
* Reverted r333424 as it broke multiple build bots and left unfixed for a long ↵Galina Kistanova2018-05-301-36/+3
| | | | | | time llvm-svn: 333578
* [llvm-readobj] Support GNU_PROPERTY_X86_FEATURE_1_AND notes in ↵Alexander Ivchenko2018-05-291-3/+36
| | | | | | | | | | | | | | .note.gnu.property This patch allows parsing GNU_PROPERTY_X86_FEATURE_1_AND notes in .note.gnu.property sections. These notes indicate that the object file is built to support Intel CET. patch by mike.dvoretsky Differential Revision: https://reviews.llvm.org/D47473 llvm-svn: 333424
* [WebAsembly] Update default triple in test files to wasm32-unknown-unkown.Sam Clegg2018-05-101-1/+1
| | | | | | | | | | Summary: The final -wasm component has been the default for some time now. Subscribers: jfb, dschuff, jgravelle-google, eraman, aheejin, JDevlieghere, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D46342 llvm-svn: 332007
* [WebAssembly] llvm-readobj: display symbols names in relocationsSam Clegg2018-05-011-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D46296 llvm-svn: 331279
* typoSam Clegg2018-04-271-0/+0
| | | | llvm-svn: 331006
* [WebAssembly] Section symbols must have local bindingSam Clegg2018-04-271-0/+0
| | | | | | | | | | Summary: Also test for symbols information in test/MC/WebAssembly/debug-info.ll. Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D46160 llvm-svn: 331005
* [WebAssembly] Add version to object file metadataSam Clegg2018-04-262-2/+2
| | | | | | | | | | Summary: See https://github.com/WebAssembly/tool-conventions/issues/54 Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D46069 llvm-svn: 330969
* [WebAssembly] Use section index in relocation section headerSam Clegg2018-04-241-0/+0
| | | | | | | | | | | Rather than referring to sections my their code, use the absolute index of the target section within the module. See https://github.com/WebAssembly/tool-conventions/issues/52 Differential Revision: https://reviews.llvm.org/D45980 llvm-svn: 330749
* Add PPC64_GLINK dynamic tag.Sean Fertile2018-04-132-0/+11
| | | | | | | | Add support for the PPC64_GLINK dynamic tag which is used in the ElfV2 abi. Differential Revision: https://reviews.llvm.org/D45574 llvm-svn: 330038
* [WebAssembly] libObject: Don't include the name the size of custom sectionsSam Clegg2018-04-121-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D45579 llvm-svn: 329947
* Fix build bot after r328078 "llvm-readobj] - Teach llvm-readobj to dump ↵George Rimar2018-03-211-2/+1
| | | | | | | | .note.gnu.property sections." BB was: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/27058/steps/test/logs/stdio llvm-svn: 328080
* [llvm-readobj] - Teach llvm-readobj to dump .note.gnu.property sections.George Rimar2018-03-212-0/+90
| | | | | | | | | | | | NT_GNU_PROPERTY_TYPE_0 is a recently added type of .note.gnu.property section specified in Linux Extensions to gABI. (https://github.com/hjl-tools/linux-abi/wiki/Linux-Extensions-to-gABI) Patch teach tool to print such notes properly. Differential revision: https://reviews.llvm.org/D44469 llvm-svn: 328078
* [llvm-readobj] Extend the output of -elf-section-groupsAlexander Shaposhnikov2018-03-122-0/+8
| | | | | | | | | | | | | | This diff extends the output of -elf-section-groups (llvm style, gnu style is unchanged since it's meant to be compatible with binutils readelf) with sh_link and sh_info. This change will enable us to use llvm-readobj -elf-section-groups for testing llvm-objcopy's support for .group sections. Test plan: make check-all Differential revision: https://reviews.llvm.org/D44280 llvm-svn: 327341
* Reland "[DebugInfo] Support DWARF expressions in eh_frame"Rafael Auler2018-03-082-0/+216
| | | | | | | | | | Summary: Original change was D43313 (r326932) and reverted by r326953 because it broke an LLD test and a windows build. The LLD test was already fixed in lld commit r326944 (thanks maskray). This is the original change with the windows build fixed. llvm-svn: 326970
* Revert r326932: [DebugInfo] Support DWARF expressions in eh_frameRui Ueyama2018-03-072-216/+0
| | | | | | This reverts commit rr326932 because it broke lld/test/ELF/eh-frame-hdr-augmentation.s. llvm-svn: 326953
* [DebugInfo] Support DWARF expressions in eh_frameRafael Auler2018-03-072-0/+216
| | | | | | | | | | | | | | | | | | This patch enhances DWARFDebugFrame with the capability of parsing and printing DWARF expressions in CFI instructions. It also makes FDEs and CIEs accessible to lib users, so they can process them in client tools that rely on LLVM. To make it self-contained with a test case, it teaches llvm-readobj to be able to dump EH frames and checks they are correct in a unit test. The llvm-readobj code is Maksim Panchenko's work (maksfb). Reviewers: JDevlieghere, espindola Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D43313 llvm-svn: 326932
* [WebAssembly] Reorder reloc sections to come between symtab and nameNicholas Wilson2018-03-052-5/+5
| | | | | | | | | | | This is required in order to enable relocs to be validated as they are read in. Also update tests with new section ordering. Differential Revision: https://reviews.llvm.org/D43940 llvm-svn: 326694
* [WebAssembly] Update pre-generated test files to match latest llc output. NFC.Nicholas Wilson2018-03-014-14/+14
| | | | | | | | The ordering of llc's output was changed in rL326334. Differential Revision: https://reviews.llvm.org/D43941 llvm-svn: 326445
* [WebAssembly] Remove DataSize from linking metadata sectionSam Clegg2018-02-271-1/+0
| | | | | | | | | | | Neither the linker nor the runtime need this information anymore. We were originally using this to model BSS size but the plan is now to use the segment metadata to allow for BSS segments. Differential Revision: https://reviews.llvm.org/D41366 llvm-svn: 326267
* [WebAssembly] Add first claass symbol table to wasm objectsSam Clegg2018-02-234-45/+20
| | | | | | | | | | | | | | | | | | | | This is combination of two patches by Nicholas Wilson: 1. https://reviews.llvm.org/D41954 2. https://reviews.llvm.org/D42495 Along with a few local modifications: - One change I made was to add the UNDEFINED bit to the binary format to avoid the extra byte used when writing data symbols. Although this bit is redundant for other symbols types (i.e. undefined can be implied if a function or global is a wasm import) - I prefer to be explicit and consistent and not have derived flags. - Some field renaming. - Some reverting of unrelated minor changes. - No test output differences. Differential Revision: https://reviews.llvm.org/D43147 llvm-svn: 325860
* Mark two tests REQUIRES: x86-registered-backendJustin Bogner2018-01-311-0/+1
| | | | | | | | These were introduced in r323783 and use an X86 triple. I'll follow up on the list to check if it would make more sense to remove the triple and mark them REQUIRES: default_triple instead. llvm-svn: 323847
* CodeGen: support an extension to pass linker options on ELFSaleem Abdulrasool2018-01-301-0/+11
| | | | | | | | | | | | | | | | | | Introduce an extension to support passing linker options to the linker. These would be ignored by older linkers, but newer linkers which support this feature would be able to process the linker. Emit a special discarded section `.linker-option`. The content of this section is a pair of strings (key, value). The key is a type identifier for the parameter. This allows for an argument free parameter that will be processed by the linker with the value being the parameter. As an example, `lib` identifies a library to be linked against, traditionally the `-l` argument for Unix-based linkers with the parameter being the library name. Thanks to James Henderson, Cary Coutant, Rafael Espinolda, Sean Silva for the valuable discussion on the design of this feature. llvm-svn: 323783
* [WebAssembly] Remove debug names from symbol tableSam Clegg2018-01-171-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Get rid of DEBUG_FUNCTION_NAME symbols. When we actually debug data, maybe we'll want somewhere to put it... but having a symbol that just stores the name of another symbol seems odd. It means you have multiple Symbols with the same name, one containing the actual function and another containing the name! Store the names in a vector on the WasmObjectFile when reading them in. Also stash them on the WasmFunctions themselves. The names are //not// "symbol names" or aliases or anything, they're just the name that a debugger should show against the function body itself. NB. The WasmObjectFile stores them so that they can be exported in the YAML losslessly, and hence the tests can be precise. Enforce that the CODE section has been read in before reading the "names" section. Requires minor adjustment to some tests. Patch by Nicholas Wilson! Differential Revision: https://reviews.llvm.org/D42075 llvm-svn: 322741
* [llvm-readobj] Support -needed-libs option for Mach-O filesPetr Hosek2018-01-081-0/+26
| | | | | | | | This implements the -needed-libs option in Mach-O dumper. Differential Revision: https://reviews.llvm.org/D41527 llvm-svn: 321980
* [llvm-readobj] Support -needed-libs option for COFF filesPetr Hosek2017-12-272-0/+5
| | | | | | | | This implements the -needed-libs option in the COFF dumper. Differential Revision: https://reviews.llvm.org/D41529 llvm-svn: 321498
* [llvm-readobj] Support 'GNU' style for MIPS GOT/PLT dumpingSimon Atanasyan2017-12-212-2/+166
| | | | | | | | | | This change adds `printMipsGOT` and `printMipsPLT` methods to the `DumpStyle` class and overrides them in the `GNUStyle` and `LLVMStyle` descendants. To pass information about GOT/PLT layout into these methods, the `MipsGOTParser` class has been extended to hold all necessary data. llvm-svn: 321253
* [llvm-readobj] Print static MIPS GOTSimon Atanasyan2017-12-022-1/+38
| | | | | | | | | | If a linked binary file contains a dynamic section, the GOT layout defined by the dynamic section entries. In a statically linked file the GOT is just a series of entries. This change teaches `llvm-readobj` to print the GOT in that case. That provides a feature parity with GNU `readelf`. llvm-svn: 319616
* Assembly tests require x86 target.Peter Collingbourne2017-10-256-0/+6
| | | | llvm-svn: 316546
* llvm-readobj: Add support for reading relocations in the Android packed format.Peter Collingbourne2017-10-259-0/+201
| | | | | | | | | | | This is in preparation for testing lld's upcoming relocation packing feature (D39152). I have verified that this implementation correctly unpacks the relocations from a Chromium DSO built with gold and the Android relocation packer for ARM32 and ARM64. Differential Revision: https://reviews.llvm.org/D39272 llvm-svn: 316543
* [codeview] Add support for inlinee listsReid Kleckner2017-10-232-0/+38
| | | | | | | | | | | This adds type index discovery and dumper support for symbol record kind 0x1168, which is a list of inlined function ids. This symbol kind is undocumented, but S_INLINEES is consistent with the existing nomenclature. Fixes PR34222 llvm-svn: 316398
* AMDGPU: Add and set AMDGPU-specific e_flagsKonstantin Zhuravlyov2017-10-051-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D38556 llvm-svn: 314987
* AMDGPU: Add ELFOSABI_AMDGPU_PALKonstantin Zhuravlyov2017-10-031-1/+1
| | | | llvm-svn: 314843
* [WebAssembly] Allow each data segment to specify its own alignmentSam Clegg2017-09-291-1/+0
| | | | | | | | | Also, add a flags field as we will almost certainly be needing that soon too. Differential Revision: https://reviews.llvm.org/D38296 llvm-svn: 314534
* Reland "[WebAssembly] Add support for naming wasm data segments"Sam Clegg2017-09-201-0/+6
| | | | | | | | | Add adds support for naming data segments. This is useful useful linkers so that they can merge similar sections. Differential Revision: https://reviews.llvm.org/D37886 llvm-svn: 313795
* [llvm-readobj] Teach readobj to dump .res files (WindowsResource).Marek Sokolowski2017-09-202-0/+163
| | | | | | | | | | This enables readobj to output Windows resource files (.res). This way, we'll be able to test .res outputs without comparing them byte-by-byte with "magic binary files" generated by MS toolchain. Differential Revision: https://reviews.llvm.org/D38058 llvm-svn: 313790
* Reverting due to Green Dragon bot failure.Mike Edwards2017-09-201-6/+0
| | | | | | http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/42594/ llvm-svn: 313706
* [WebAssembly] Add support for naming wasm data segmentsSam Clegg2017-09-191-0/+6
| | | | | | | | | Add adds support for naming data segments. This is useful useful linkers so that they can merge similar sections. Differential Revision: https://reviews.llvm.org/D37886 llvm-svn: 313692
* [llvm-readobj] - Teach tool to report error if some section is in multiple ↵George Rimar2017-09-161-0/+77
| | | | | | | | | | | | COMDAT groups at once. readelf tool reports an error when output contains the same section in multiple COMDAT groups. That can be useful. Path teaches llvm-readobj to do the same. Differential revision: https://reviews.llvm.org/D37567 llvm-svn: 313459
* [WebAssembly] Only treat imports/exports as symbols when reading relocatable ↵Sam Clegg2017-09-061-6/+6
| | | | | | | | | | | | | | | | | | | object files This change only treats imported and exports functions and globals as symbol table entries the object has a "linking" section (i.e. it is relocatable object file). In this case all globals must be of type I32 and initialized with i32.const. This was previously being assumed but not checked for and was causing a failure on big endian machines due to using the wrong value of then union. See: https://bugs.llvm.org/show_bug.cgi?id=34487 Differential Revision: https://reviews.llvm.org/D37497 llvm-svn: 312674
* [WebAssembly] Update relocation names to match specSam Clegg2017-09-011-1/+1
| | | | | | | | Summary: See https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md Differential Revision: https://reviews.llvm.org/D37385 llvm-svn: 312342
* [Object] Initialize LoadConfig member to nullReid Kleckner2017-08-072-0/+5
| | | | | | | | | | Executables may not contain a load config, and clients should be able to test for nullability. Previously we'd return uninitialized memory. Now getLoadConfig32/64 return valid pointers or null. Fixes PR34108 llvm-svn: 310308
OpenPOWER on IntegriCloud