summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/yaml2obj/ELF
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[yaml2obj/obj2yaml] - Add support for SHT_RELR sections."Georgii Rymar2020-01-151-207/+0
| | | | | | This reverts commit 46d11e30ee807accefd14e0b7f306647963a39b5. It broke bots. E.g. http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/60744
* [yaml2obj/obj2yaml] - Add support for SHT_RELR sections.Georgii Rymar2020-01-151-0/+207
| | | | | | | | | | | | | | | The encoded sequence of Elf*_Relr entries in a SHT_RELR section looks like [ AAAAAAAA BBBBBBB1 BBBBBBB1 ... AAAAAAAA BBBBBB1 ... ] i.e. start with an address, followed by any number of bitmaps. The address entry encodes 1 relocation. The subsequent bitmap entries encode up to 63(31) relocations each, at subsequent offsets following the last address entry. More information is here: https://github.com/llvm-mirror/llvm/blob/master/lib/Object/ELF.cpp#L272 This patch adds a support for these sections. Differential revision: https://reviews.llvm.org/D71872
* [test] do not parse ls output for file size; NFCIBryan Chan2019-12-301-2/+2
| | | | | | | | Parsing `ls -l` output to obtain the size of a file is unreliable; the exact output format is not specified, and some user or group names may contain multiple words, causing `cut -f5 -d' '` to extract an incorrect value. `wc -c`, on the other hand, is portable, and there are precendents of its use in test cases.
* [yaml2obj] - Allow using an arbitrary value for OSABI.Georgii Rymar2019-12-231-0/+13
| | | | | | | There was no way to set an unsupported or unknown OS ABI. With this patch it is possible to use any numeric value. Differential revision: https://reviews.llvm.org/D71765
* [yaml2obj] - Add support for ELFOSABI_LINUX.Georgii Rymar2019-12-231-21/+31
| | | | | | | ELFOSABI_LINUX is an alias for ELFOSABI_GNU. It is not that obvious probably. Differential revision: https://reviews.llvm.org/D71764
* [yaml2obj] - Add testing for OSABI field.Georgii Rymar2019-12-231-0/+317
| | | | | | | We have no such testing. This makes impossible to add support for new ELFOSABI_* tags. Differential revision: https://reviews.llvm.org/D71763
* [yaml2obj] - Add a way to override sh_flags section field.Georgii Rymar2019-12-131-0/+90
| | | | | | | | | | | | | | | Currently we have the `Flags` property that allows to set flags for a section. The problem is that it does not allow us to set an arbitrary value, because of bit fields validation under the hood. An arbitrary values can be used to test specific broken cases. We probably do not want to relax the validation, so this patch adds a `ShSize` property that allows to override the `sh_size`. It is inline with others `Sh*` properties we have already. Differential revision: https://reviews.llvm.org/D71411
* [ELF] Support for PT_GNU_PROPERTY in header and toolsPeter Smith2019-12-041-0/+4
| | | | | | | | | | | | | The PT_GNU_PROPERTY is generated by a linker to describe the .note.gnu.property section. The Linux kernel uses this program header to locate the .note.gnu.property section. It is described in "The Linux gABI extension" Include support for llvm-readelf, llvm-readobj and the yaml reader and writers. Differential Revision: https://reviews.llvm.org/D70959
* [yaml2obj] - Make DynamicSymbols to be Optional<> too.Georgii Rymar2019-12-046-35/+83
| | | | | | | | | | | | | | | | | | We already have Symbols property to list regular symbols and it is currently Optional<>. This patch makes DynamicSymbols to be optional too. With this there is no need to define a dummy symbol anymore to trigger creation of the .dynsym and it is now possible to define an empty .dynsym using just the following line: DynamicSymbols: [] (it is important to have when you do not want to have dynamic symbols, but want to have a .dynsym) Now the code is consistent and it helped to fix a bug: previously we did not report an error when both Content/Size and an empty Symbols/DynamicSymbols list were specified. Differential revision: https://reviews.llvm.org/D70956
* [yaml2obj][test] - Remove excessive symtab-shinfo.yaml.Georgii Rymar2019-12-041-43/+0
| | | | | | | The same testing is performed in `implicit-sections-info.yaml`: https://github.com/llvm-mirror/llvm/blob/master/test/tools/yaml2obj/implicit-sections-info.yaml Differential revision: https://reviews.llvm.org/D70957
* [yaml2obj] - Add a way to describe content of the SHT_GNU_verneed section ↵Georgii Rymar2019-11-291-2/+76
| | | | | | | | | with "Content". There is no way to set raw content for SHT_GNU_verneed section. This patch implements it. Differential revision: https://reviews.llvm.org/D70816
* [llvm-readobj] - Always print "Predecessors" for version definition sections.Georgii Rymar2019-11-271-0/+2
| | | | | | | | | | | | | This is a follow-up discussed in D70495 thread. The current logic is unusual for llvm-readobj. It doesn't print predecessors list when it is empty. This is not good for machine parsers. D70495 had to add this condition during refactoring to reduce amount of changes, in tests, because the original code also had a similar logic. Now seems it is time to get rid of it. This patch does it. Differential revision: https://reviews.llvm.org/D70717
* [llvm-readobj/llvm-readelf] - Reimplement dumping of the SHT_GNU_verdef section.Georgii Rymar2019-11-261-1/+1
| | | | | | | | | | | | Currently we have following issues: 1) We have 2 different implementations with a different behaviors for GNU/LLVM styles. 2) Errors are either not handled at all or we call report_fatal_error with not helpfull messages. 3) There is no test coverage even for those errors that are reported. This patch reimplements parsing of the SHT_GNU_verdef section entries in a single place, adds a few error messages and test coverage. Differential revision: https://reviews.llvm.org/D70495
* [yaml2obj] - Fix BB after «[yaml2obj] - Teach tool to describe ↵Georgii Rymar2019-11-261-1/+1
| | | | | | | | SHT_GNU_verdef section with a "Content" property.» Fixed a temporary file name. BB: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-ubuntu/builds/669
* [yaml2obj] - Teach tool to describe SHT_GNU_verdef section with a "Content" ↵Georgii Rymar2019-11-261-2/+81
| | | | | | | | | property. There is no way to set raw content for SHT_GNU_verdef section. This patch implements it. Differential revision: https://reviews.llvm.org/D70710
* [yaml2obj/obj2yaml] - Add support for SHT_LLVM_DEPENDENT_LIBRARIES sections.Georgii Rymar2019-11-251-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | This section contains strings specifying libraries to be added to the link by the linker. The strings are encoded as standard null-terminated UTF-8 strings. This patch adds a way to describe and dump SHT_LLVM_DEPENDENT_LIBRARIES sections. I introduced a new YAMLFlowString type here. That used to teach obj2yaml to dump them like: ``` Libraries: [ foo, bar ] ``` instead of the following (if StringRef would be used): ``` Libraries: - foo - bar ``` Differential revision: https://reviews.llvm.org/D70598
* [llvm-readobj/llvm-readelf] - Improve dumping of versioning sections.Georgii Rymar2019-11-203-8/+24
| | | | | | | | | | | | | Our elf-versioninfo.test is not perfect. It does not properly test how flags are dumped and also we have a bug: they are dumped as enums in LLVM style now, i.e not dumped properly. GNU style uses a `versionFlagToString` method to build a string from flags which seems is consistent with GNU readelf. In this patch I fixed the issues mentioned. Differential revision: https://reviews.llvm.org/D70399
* [yaml2obj][test] Move tests to binary format specific subdirectoriesFangrui Song2019-11-1872-0/+6151
Create COFF/, ELF/, and Minidump and move tests there. Also * Rename `*.test` to `*.yaml` * For yaml2obj RUN lines, use `-o %t` instead of `> %t` for consistency. We still have tests that check stdout is the default output, e.g. multi-doc.test * Update tests to consistently use `##` for comments. `#` is for RUN and CHECK lines. * Merge symboless-relocation.yaml and invalid-symboless-relocation.yaml to ELF/relocation-implicit-symbol-index.test Reviewed By: grimar, jhenderson Differential Revision: https://reviews.llvm.org/D70264
OpenPOWER on IntegriCloud