summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object/obj2yaml.test
Commit message (Collapse)AuthorAgeFilesLines
* [test/Object] - Cleanup the Object\obj2yaml.test a bit.George Rimar2019-08-061-10/+0
| | | | | | | | | | | | | | | This makes 2 changes: 1) Removes unwind-section.elf-x86-64 object and the corresponding test case, because SHT_X86_64_UNWIND is already tested here: https://github.com/llvm-mirror/llvm/blob/master/test/tools/obj2yaml/section-type.yaml 2) Removes/partially moves "No such file or directory" test, because we already have a similar test here: https://github.com/llvm-mirror/llvm/blob/master/test/tools/obj2yaml/invalid_input_file.test Differential revision: https://reviews.llvm.org/D65570 llvm-svn: 368044
* [llvm\test\Object] - An initial step to cleanup the test cases.George Rimar2019-07-081-705/+778
| | | | | | | | | | | | This patch removes trivial-object-test.elf-i386, trivial-object-test.elf-x86-64 and trivial-object-test2.elf-x86-64 precompiled objects from test/Object/Inputs folder. I adjusted the existent test cases to use YAML instead. Differential revision: https://reviews.llvm.org/D64206 llvm-svn: 365348
* [yaml2obj/obj2yaml] - Make RawContentSection::Content and ↵George Rimar2019-06-101-7/+0
| | | | | | | | | | | | | | | | RawContentSection::Size optional This is a follow-up for D62809. Content and Size fields should be optional as was discussed in comments of the D62809's thread. With that, we can describe a specific string table and symbol table sections in a more correct way and also show appropriate errors. The patch adds lots of test cases where the behavior is described in details. Differential revision: https://reviews.llvm.org/D62957 llvm-svn: 362931
* [yaml2obj][obj2yaml] - Change how symbol's binding is descibed when ↵George Rimar2019-04-031-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parsing/dumping. Currently, YAML has the following syntax for describing the symbols: Symbols: Local: LocalSymbol1: ... LocalSymbol2: ... ... Global: GlobalSymbol1: ... Weak: ... GNUUnique: I.e. symbols are grouped by their bindings. That is not very convenient, because: It does not allow to set a custom binding, what can be useful for producing broken/special outputs for test cases. Adding a new binding would require to change a syntax (what we observed when added GNUUnique recently). It does not allow to change the order of the symbols in .symtab/.dynsym, i.e. currently all Local symbols are placed first, then Global, Weak and GNUUnique are following, but we are not able to change the order. It is not consistent. Binding is just one of the properties of the symbol, we do not group them by other properties. It makes the code more complex that it can be. This patch shows it can be simplified with the change performed. The patch changes the syntax to just: Symbols: Symbol1: ... Symbol2: ... ... With that, we are able to work with the binding field just like with any other symbol property. Differential revision: https://reviews.llvm.org/D60122 llvm-svn: 357595
* Fix BB after r354661George Rimar2019-02-221-0/+5
| | | | | | Update 2 test cases after obj2yaml fix in r354661. llvm-svn: 354663
* [obj2yaml] - Dump the sh_entsize section field.George Rimar2019-01-281-0/+5
| | | | | | | | | | | | I faced with the fact that obj2yaml does not dump the sh_entsize field. A problem arose when I tried to dump ELF versioning sections. This is close to what D50235 did, but D50235 did the change for yaml2obj, and now I had to do the same for obj2yaml. Differential revision: https://reviews.llvm.org/D57229 llvm-svn: 352373
* [WebAssembly] Store section alignment as a power of 2Sam Clegg2019-01-161-2/+2
| | | | | | | | | | | This change bumps for version number of the wasm object file metadata. See https://github.com/WebAssembly/tool-conventions/pull/92 Differential Revision: https://reviews.llvm.org/D56758 llvm-svn: 351285
* [WebAssembly] Update more test cases after FixFunctionBitcastsHeejin Ahn2018-11-071-1/+3
| | | | | | These test updates were missing from rL346286. llvm-svn: 346291
* [WebAssembly] Add version to object file metadataSam Clegg2018-04-261-0/+1
| | | | | | | | | | 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] Update pre-generated test files to match latest llc output. NFC.Nicholas Wilson2018-03-011-9/+9
| | | | | | | | 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-231-8/+30
| | | | | | | | | | | | | | | | | | | | 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
* [ObjectYAML] Map relocation types for COFF ARMNT and ARM64Martin Storsjo2017-11-061-0/+158
| | | | | | Differential Revision: https://reviews.llvm.org/D39668 llvm-svn: 317459
* Use the section name if a STT_SECTION symbol has empty name.Rafael Espindola2017-09-061-18/+35
| | | | | | | | | | | | | Without this we would have multiple relocations pointing to symbols with the same name: the empty string. There was no way for yaml2obj to be able to handle that. A more general solution would be to unique symbol names in a similar way to how we unique section names. In practice I think this covers all common cases and is a bit more user friendly than using names like sym1, sym2, sym3, etc. llvm-svn: 312603
* [WebAssembly] Be consistent in generating trivial test input filesSam Clegg2017-07-101-7/+18
| | | | | | | | | | | | | 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
* obj2yaml: Improve error reportingSam Clegg2017-06-161-1/+1
| | | | | | | | | | Previously only the error codes were reported which meant that useful information about malformed inputs was not shown. Differential Revision: https://reviews.llvm.org/D34008 llvm-svn: 305609
* [llvm-readobj][ELF] Teach llvm-readobj to show arch specific ELF section's flagsSimon Atanasyan2016-01-201-1/+1
| | | | | | | | | | | | | | Some architecture specific ELF section flags might have the same value (for example SHF_X86_64_LARGE and SHF_HEX_GPREL) and we have to check machine architectures to select an appropriate set of possible flags. The patch selects architecture specific flags into separate arrays `ElfxxxSectionFlags` and combines `ElfSectionFlags` and `ElfxxxSectionFlags` before pass to the `StreamWriter::printFlags()` method. Differential Revision: http://reviews.llvm.org/D16269 llvm-svn: 258334
* [AVR] Add ELF constants to headersDylan McKay2015-10-231-0/+62
| | | | | | | | Also adds a 'trivial' ELF file. This was generated by assembling and linking a file with the symbol main which contains a single return instruction. llvm-svn: 251096
* Fixup r248096, commit the *correct* test.Davide Italiano2015-09-191-2/+2
| | | | llvm-svn: 248097
* [obj2yaml] Fix "time of check to time of use" bug. Add a test.Davide Italiano2015-09-191-0/+3
| | | | llvm-svn: 248096
* [ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj toolsSimon Atanasyan2015-07-031-2/+1
| | | | | | | | | | SHT_NOBITS sections do not have content in an object file. Now the yaml2obj tool does not accept `Content` field for such sections, and the obj2yaml tool does not attempt to read the section content from a file. Restore r241350 and r241352. llvm-svn: 241377
* This reverts commit r241350 and r241352.Rafael Espindola2015-07-031-1/+2
| | | | | | | | | | | r241350 broke lld tests. r241352 depends on r241350. Original messages: "[ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj tools" "[ELFYAML] Make the Size field for .bss section optional" llvm-svn: 241354
* [ELFYAML] Make the Size field for .bss section optionalSimon Atanasyan2015-07-031-1/+0
| | | | | | It's a common case to have a zero-size .bss section in an object file. llvm-svn: 241352
* [ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj toolsSimon Atanasyan2015-07-031-2/+2
| | | | | | | | SHT_NOBITS sections do not have content in an object file. Now yaml2obj tool does not accept `Content` field for such sections, and obj2yaml tool does not attempt to read the section content from a file. llvm-svn: 241350
* Fix the interpretation of a 0 st_name.Rafael Espindola2015-06-031-31/+16
| | | | | | | | | | | | | | The ELF spec is very clear: ----------------------------------------------------------------------------- If the value is non-zero, it represents a string table index that gives the symbol name. Otherwise, the symbol table entry has no name. -------------------------------------------------------------------------- In particular, a st_name of 0 most certainly doesn't mean that the symbol has the same name as the section. llvm-svn: 238899
* [obj2yaml/yaml2obj] Add SHT_MIPS_ABIFLAGS section supportSimon Atanasyan2015-05-071-1/+6
| | | | | | | This change adds support for the SHT_MIPS_ABIFLAGS section reading/writing to the obj2yaml and yaml2obj tools. llvm-svn: 236738
* [ELFYAML] Provide default value 0 for YAML relocation addendum fieldSimon Atanasyan2015-01-291-8/+0
| | | | | | Follow up to r227318. llvm-svn: 227422
* [Mips] Support SHT_MIPS_ABIFLAGS section type flag in the llvm-readobj,Simon Atanasyan2014-07-131-1/+21
| | | | | | obj2yaml and yaml2obj tools. llvm-svn: 212908
* [ELFYAML] Group ELF section type flags to target specific blocks.Simon Atanasyan2014-07-121-0/+8
| | | | | | Recognize only flags which correspond to the current target. llvm-svn: 212880
* [elf2yaml][ELF] Move Info field to the RelocationSection structure. ThisSimon Atanasyan2014-05-291-3/+3
| | | | | | | field represents ELF section header sh_info field and does not have any sense for regular sections. Its interpretation depends on section type. llvm-svn: 209801
* [YAML] Add an optional argument `EnumMask` to the `yaml::IO::bitSetCase()`.Simon Atanasyan2014-05-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some bit-set fields used in ELF file headers in fact contain two parts. The first one is a regular bit-field. The second one is an enumeraion. For example ELF header `e_flags` for MIPS target might contain the following values: Bit-set values: EF_MIPS_NOREORDER = 0x00000001 EF_MIPS_PIC = 0x00000002 EF_MIPS_CPIC = 0x00000004 EF_MIPS_ABI2 = 0x00000020 Enumeration: EF_MIPS_ARCH_32 = 0x50000000 EF_MIPS_ARCH_64 = 0x60000000 EF_MIPS_ARCH_32R2 = 0x70000000 EF_MIPS_ARCH_64R2 = 0x80000000 For printing bit-sets we use the `yaml::IO::bitSetCase()`. It does not support bit-set/enumeration combinations and prints too many flags from an enumeration part. This patch fixes this problem. New method `yaml::IO::maskedBitSetCase()` handle "enumeration" part of bitset defined by provided mask. Patch reviewed by Nick Kledzik and Sean Silva. llvm-svn: 209504
* [obj2yaml][ELF] Print relocation's offset as a hex number. Use a properSimon Atanasyan2014-05-151-10/+10
| | | | | | types to hold relocation's offset and addend. llvm-svn: 208906
* [obj2yaml][ELF] Do not print empty Link and Info fields for ELF sections.Simon Atanasyan2014-05-151-26/+0
| | | | llvm-svn: 208905
* [obj2yaml] Support ELF input format in the obj2yaml tool.Simon Atanasyan2014-05-141-1/+249
| | | | | | | | | | The ELF header e_flags field in the MIPS related test cases handled incorrectly. The obj2yaml prints too many flags. I will fix that in the next patches. The patch reviewed by Michael Spencer and Sean Silva. llvm-svn: 208752
* Revert "Revert "YAMLIO: Encode ambiguous hex strings explicitly""David Majnemer2014-04-091-1/+1
| | | | | | | | | Don't quote octal compatible strings if they are only two wide, they aren't ambiguous. This reverts commit r205857 which reverted r205857. llvm-svn: 205914
* obj2yaml: Use the correct relocation type for different machine typesDavid Majnemer2014-04-071-2/+18
| | | | | | | | | | | | | The IO normalizer would essentially lump I386 and AMD64 relocations together. Relocation types with the same numeric value would then get mapped in appropriately. For example: IMAGE_REL_AMD64_ADDR64 and IMAGE_REL_I386_DIR16 both have a numeric value of one. We would see IMAGE_REL_I386_DIR16 in obj2yaml conversions of object files with a machine type of IMAGE_FILE_MACHINE_AMD64. llvm-svn: 205746
* Object: Provide a richer means of describing auxiliary symbolsDavid Majnemer2014-03-191-8/+24
| | | | | | | | | | | | | | | | The current state of affairs has auxiliary symbols described as a big bag of bytes. This is less than satisfying, it detracts from the YAML file as being human readable. Instead, allow for symbols to optionally contain their auxiliary data. This allows us to have a much higher level way of describing things like weak symbols, function definitions and section definitions. This depends on D3105. Differential Revision: http://llvm-reviews.chandlerc.com/D3092 llvm-svn: 204214
* Print symbol names in relocations when dumping COFF as YAML.Rafael Espindola2013-06-061-6/+6
| | | | llvm-svn: 183403
* Don't print default values for NumberOfAuxSymbols and AuxiliaryData.Rafael Espindola2013-06-051-0/+1
| | | | llvm-svn: 183293
* Use std::list so that we have a stable iterator.Rafael Espindola2013-05-211-3/+2
| | | | | | | I will try to avoid creating these std::strings, but for now this gets the tests passing with libc++. llvm-svn: 182405
* Temporarily disable this test because it is failing when using libc++.Bob Wilson2013-05-191-2/+3
| | | | llvm-svn: 182212
* Convert obj2yaml to use yamlio.Rafael Espindola2013-05-171-96/+78
| | | | llvm-svn: 182169
* Add a test for obj2yaml in preparation for refactoring it.Rafael Espindola2013-04-051-0/+170
llvm-svn: 178829
OpenPOWER on IntegriCloud