summaryrefslogtreecommitdiffstats
path: root/llvm/test/ObjectYAML
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* [WebAssembly] Improve libObject support for wasm imports and exportsSam Clegg2017-05-092-16/+57
| | | | | | | | | | | | Previously we had only supported the importing and exporting of functions and globals. Also, add usefull overload of getWasmSymbol() and getNumberOfSymbols() in support of lld port. Differential Revision: https://reviews.llvm.org/D33011 llvm-svn: 302601
* [WebAssembly] Fix validation of start functionSam Clegg2017-05-092-3/+10
| | | | | | | | | | The check for valid start function was inverted. Added a new test in test/Object to check this case and fixed the existing tests in for ObjectYAML. Differential Revision: https://reviews.llvm.org/D32986 llvm-svn: 302560
* [WebAssembly] Add ObjectYAML support for wasm name sectionSam Clegg2017-05-051-0/+40
| | | | | | Differential Revision: https://reviews.llvm.org/D32841 llvm-svn: 302266
* [WebAssembly] Allow for signed relocation addendsSam Clegg2017-04-262-11/+25
| | | | | | | | | | | | | | Summary: Addends are used as offsets to addresses of globals and can be both positive and negative. This change prints libObject in line with the spec and the MC layer. Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32507 llvm-svn: 301369
* [WebAssembly] Read global index in init expression as LEBSam Clegg2017-04-251-4/+4
| | | | | | | | Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32462 llvm-svn: 301330
* [Test commit] Cleanup some whitespace in a test fileSam Clegg2017-04-141-2/+0
| | | | llvm-svn: 300361
* Align all scalar numbers to LLVM_YAML_IS_FLOW_SEQUENCE_VECTORJonas Hahnfeld2017-04-043-33/+5
| | | | | | | | | Otherwise, yamlize in YAMLTraits.h might be wrongly defined. This makes some AMDGPU tests fail when LLVM_LINK_LLVM_DYLIB is set. Differential Revision: https://reviews.llvm.org/D30508 llvm-svn: 299415
* [WebAssembly] Improve support for WebAssembly binary formatDerek Schuff2017-03-3014-0/+384
| | | | | | | | | | | | | | | | | | | 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
* [ObjectYAML] Fix issue with DWARF2 AddrSize 8Chris Bieneman2017-03-071-0/+507
| | | | | | | | In my refactoring I introduced a bug where we were using the reference size instead of the offset size for DW_FORM_strp and similar forms. This patch resolves the error and adds a test case testing all the DWARF forms for DWARF2 AddrSize 8. There is similar coverage already in the DWARFDebugInfoTest sources that covers the parser. Once I migrate the DWARFGenerator APIs to be built on the YAML tools they will be fully covered under the same tests. llvm-svn: 297230
* [ObjectYAML] Add support for DWARF5 Unit headerChris Bieneman2017-03-071-0/+582
| | | | | | In DWARF5 the Unit header added a new field, UnitType, and swapped the order of the address size and abbreviation offset fields. llvm-svn: 297183
* [ObjectYAML] Support for DW_FORM_implicit_const DWARF5 formChris Bieneman2017-03-061-0/+307
| | | | | | | | This patch adds support to the DWARF YAML reader and writer for the new DWARF5 abbreviation form, DW_FORM_implicit_const. The attribute was added in r291599. llvm-svn: 297091
* [ObjectYAML] [DWARF] Abstract DWARF Initial Length valuesChris Bieneman2017-03-034-16/+32
| | | | | | | | In the DWARF 4 Spec section 7.2.2, data in many DWARF sections, and some DWARF structures start with "Initial Length Values", which are a 32-bit length, and an optional 64-bit length if the 32 bit value == UINT32_MAX. This patch abstracts the Initial Length type in YAML, and extends its use to all the DWARF structures that are supported in the DWARFYAML code that have Initial Length values. llvm-svn: 296911
* Attempt to fix the testcase in r292824Steven Wu2017-01-231-31/+8
| | | | | | | Try fix the testcase r292824 (failing on some bots) by reduce it to the minimal. If this fix doesn't work, I will revert this test. llvm-svn: 292826
* Add LC_BUILD_VERSION load commandSteven Wu2017-01-231-0/+58
| | | | | | | | | | | | | | | | | | | Summary: Add a new load command LC_BUILD_VERSION. It is a generic version of LC_*_VERSION_MIN load_command used on Apple platforms. Instead of having a seperate load command for each platform, LC_BUILD_VERSION is recording platform info as an enum. It also records SDK version, min_os, and tools that used to build the binary. rdar://problem/29781291 Reviewers: enderby Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29044 llvm-svn: 292824
* Remove this test from the r292500 commit till Chris and I figure outKevin Enderby2017-01-191-50/+0
| | | | | | why it is failing on a couple of build bots. llvm-svn: 292501
* Add support for the new LC_NOTE load command.Kevin Enderby2017-01-191-0/+50
| | | | | | | | | | It describes a region of arbitrary data included in a Mach-O file. Its initial use is to record extra data in MH_CORE files. rdar://30001545 rdar://30001731 llvm-svn: 292500
* [ObjectYAML] Missed one mixup in the debug_line testChris Bieneman2017-01-101-1/+0
| | | | llvm-svn: 291547
* [ObjectYAML] Support for DWARF line tablesChris Bieneman2017-01-102-0/+648
| | | | | | | | | | | | | | One more try... relanding r291541 with a fix to properly gate MaxOpsPerInst on DWARF version. Description from r291541: This patch re-lands r291470, which failed on Linux bots. The issue (I believe) was undefined behavior because the size of llvm::dwarf::LineNumberOps was not explcitly specified or consistently respected. The updated patch adds an explcit underlying type to the enum and preserves the size more correctly. Original description: This patch adds support for the DWARF debug_lines section. The line table state machine opcodes are preserved, so this can be used to test the state machine evaluation directly. llvm-svn: 291546
* Revert "[ObjectYAML] Support for DWARF line tables"Chris Bieneman2017-01-102-650/+0
| | | | | | | | | | This reverts commit r291541. Still failing on a bot: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/47224/steps/test_llvm/logs/stdio llvm-svn: 291542
* [ObjectYAML] Support for DWARF line tablesChris Bieneman2017-01-102-0/+650
| | | | | | | | | | This patch re-lands r291470, which failed on Linux bots. The issue (I believe) was undefined behavior because the size of llvm::dwarf::LineNumberOps was not explcitly specified or consistently respected. The updated patch adds an explcit underlying type to the enum and preserves the size more correctly. Original description: This patch adds support for the DWARF debug_lines section. The line table state machine opcodes are preserved, so this can be used to test the state machine evaluation directly. llvm-svn: 291541
* Revert "[ObjectYAML] Support for DWARF line tables"Chris Bieneman2017-01-092-650/+0
| | | | | | | | This reverts commit r291470 due to failing bots: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/47209/steps/test_llvm/logs/stdio llvm-svn: 291471
* [ObjectYAML] Support for DWARF line tablesChris Bieneman2017-01-092-0/+650
| | | | | | This patch adds support for the DWARF debug_lines section. The line table state machine opcodes are preserved, so this can be used to test the state machine evaluation directly. llvm-svn: 291470
* [ObjectYAML] Support for DWARF debug_info sectionChris Bieneman2016-12-221-0/+525
| | | | | | | | | | This patch adds support for YAML<->DWARF for debug_info sections. This re-lands r290147, reverted in 290148, re-landed in r290204 after fixing the issue that caused bots to fail (thank you UBSan!), and reverted again in r290209 due to failures on big endian systems. After adding support for preserving endianness, this should be good now. llvm-svn: 290386
* [ObjectYAML] Fixing big endian bots from r290381Chris Bieneman2016-12-221-1/+0
| | | | | | | Bot URL: http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/2505 llvm-svn: 290383
* [ObjectYAML] MachO support for endiannessChris Bieneman2016-12-224-0/+1191
| | | | | | This patch adds support to the macho<->yaml tools for preserving endianness in MachO structures and DWARF data. llvm-svn: 290381
* Revert "[ObjectYAML] Support for DWARF debug_info section"Chris Bieneman2016-12-201-525/+0
| | | | | | | | | | | This reverts commit r290204. Still breaking bots... In a meeting now, so I can't fix it immediately. Bot URL: http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/2415 llvm-svn: 290209
* [ObjectYAML] Support for DWARF debug_info sectionChris Bieneman2016-12-201-0/+525
| | | | | | | | This patch adds support for YAML<->DWARF for debug_info sections. This re-lands r290147, after fixing the issue that caused bots to fail (thank you UBSan!). llvm-svn: 290204
* Revert "[ObjectYAML] Support for DWARF debug_info section"Chris Bieneman2016-12-201-525/+0
| | | | | | | | This reverts commit r290147. This commit is breaking a bot (http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/621). I don't have time to investigate at the moment, so I'll revert for now. llvm-svn: 290148
* [ObjectYAML] Support for DWARF debug_info sectionChris Bieneman2016-12-201-0/+525
| | | | | | This patch adds support for YAML<->DWARF for debug_info sections. llvm-svn: 290147
* [ObjectYAML] Support for DWARF Pub SectionsChris Bieneman2016-12-191-0/+355
| | | | | | This patch adds support for YAML<->DWARF round tripping for pub* section data. The patch supports both GNU and non-GNU style entries. llvm-svn: 290139
* [ObjectYAML] Support for DWARF debug_arangesChris Bieneman2016-12-091-0/+335
| | | | | | This patch adds support for round tripping DWARF debug_aranges in and out of YAML. llvm-svn: 289161
* [ObjectYAML] Rename DWARF entries to match section namesChris Bieneman2016-12-072-4/+4
| | | | | | This change makes the yaml tags for the members of the DWARF data match the names of the DWARF sections. llvm-svn: 288981
* [ObjectYAML] Support for DWARF __debug_abbrev sectionChris Bieneman2016-12-071-0/+433
| | | | | | This patch adds support for round-tripping DWARF debug abbreviations through the obj<->yaml tools. llvm-svn: 288955
* [ObjectYAML] First bit of support for encoding DWARF in MachOChris Bieneman2016-12-061-0/+266
| | | | | | This patch adds the starting support for encoding data from the MachO __DWARF segment. The first section supported is the __debug_str section because it is the simplest. llvm-svn: 288774
* [macho2yaml] Don't write empty linkedit dataChris Bieneman2016-08-171-0/+1
| | | | | | | | Since I stopped writing empty export tries it causes LinkEdit to potentially be completely empty which results in invalid yaml being generated. To prevent this we skip linkedit data if it is empty. llvm-svn: 278985
* [Mach0YAML] Change n_type from uint8_t to llvm::yaml::Hex8Chris Bieneman2016-08-041-60/+60
| | | | | | Since this field is generally masked, it is way easier to understand it as a Hex value than decimal. llvm-svn: 277770
* [macho2yaml] String table can contain null stringsChris Bieneman2016-08-041-0/+208
| | | | | | | | Since the string table being read from the MachO is a properly bounded StringRef including null strings is safe and reasonable. This occurs frequently with stripped binaries where the string table has been modified. llvm-svn: 277753
* [YAML] Fix YAML tags appearing before the start of sequence elementsChris Bieneman2016-06-281-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Our existing yaml::Output code writes tags immediately when mapTag is called, without any state handling. This results in tags on sequence elements being written before the element itself. For example, we see this: SomeArray: !elem_type - key1: 1 key2: 2 !elem_type2 - key3: 3 key4: 4 We should instead see: SomeArray: - !elem_type key1: 1 key2: 2 - !elem_type2 key3: 3 key4: 4 Our reader handles reading properly, so this bug only impacts writing yaml sequences with tagged elements. As a test for this I've modified the Mach-O yaml encoding to allways apply the !mach-o tag when encoding MachOYAML::Object entries. This results in the !mach-o tag appearing as expected in dumped fat files. llvm-svn: 274067
* [yaml2obj] Remove --format option in favor of YAML tagsChris Bieneman2016-06-2715-15/+15
| | | | | | | | | | | | | | | | | | | | | | 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
* [obj2yaml] [yaml2obj] Support for MachO Universal binariesChris Bieneman2016-06-241-0/+72
| | | | | | This patch adds round-trip support for MachO Universal binaries to obj2yaml and yaml2obj. Universal binaries have a header and list of architecture structures, followed by a the individual object files at specified offsets. llvm-svn: 273719
* [yaml2macho] Removing asserts in favor of explicit yaml parse errorChris Bieneman2016-06-232-0/+16
| | | | | | | | | | | | 32-bit Mach headers don't have reserved fields. When generating the mapping for 32-bit headers leaving off the reserved field will result in parse errors if the field is present in the yaml. Added a CHECK-NOT line to ensure that mach_header.yaml isn't adding a reserved field, and a test to ensure that the parser error gets hit with 32-bit headers. llvm-svn: 273623
* [yaml2obj] Sort MachO LinkEdit write operations based on offsetChris Bieneman2016-06-031-0/+266
| | | | | | | | This re-applies r271611, and hopefully the bots won't break this time. Although ld64 always outputs linkedit data in the same order, it isn't actually required to. This change makes yaml2obj resilient if the offsets are in arbitrary order. llvm-svn: 271687
* Revert "[yaml2obj] Sort MachO LinkEdit write operations based on offset"Chris Bieneman2016-06-021-266/+0
| | | | | | | | | | This reverts commit r271611 because it broke a bot: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/38184 I don't currently have a handle on what went wrong, so I'll revert while I investigate. llvm-svn: 271613
* [yaml2obj] Sort MachO LinkEdit write operations based on offsetChris Bieneman2016-06-021-0/+266
| | | | | | Although ld64 always outputs linkedit data in the same order, it isn't actually required to. This change makes yaml2obj resilient if the offsets are in arbitrary order. llvm-svn: 271611
* [obj2yaml] [yaml2obj] Support for MachO nlist and string tableChris Bieneman2016-06-021-0/+511
| | | | | | This commit adds round tripping for MachO symbol data. Symbols are entries in the name list, that contain offsets into the string table which is at the end of the __LINKEDIT segment. llvm-svn: 271604
* [obj2yaml][yaml2obj] Support for reading and dumping the MachO export trieChris Bieneman2016-05-311-0/+191
| | | | | | The MachO export trie is a serially encoded trie keyed by symbol name. This code parses the trie and preserves the structure so that it can be dumped again. llvm-svn: 271300
* [obj2yaml][yaml2obj] Support for MachO lazy bindingsChris Bieneman2016-05-261-0/+466
| | | | | | This adds support for YAML round tripping dyld info lazy bindings. The storage and format of these is the same as regular bind opcodes, they are just interpreted differently by dyld, and can have DONE opcodes in the middle of the opcode lists. llvm-svn: 270920
* [obj2yaml][yaml2obj] Support for MachO weak bindingsChris Bieneman2016-05-261-0/+133
| | | | | | This adds support for YAML round tripping dyld info weak bindings. The storage and format of these is the same as regular bind opcodes, they are just interpreted differently by dyld. llvm-svn: 270911
* [obj2yaml][yaml2obj] Support for MachO bind opcodesChris Bieneman2016-05-261-0/+133
| | | | | | This adds support for YAML round tripping dyld info bind opcodes. Bind opcodes can have signed or unsigned LEB128 data, and they can have symbols associated with them. llvm-svn: 270901
OpenPOWER on IntegriCloud