summaryrefslogtreecommitdiff
path: root/test/ObjectYAML
AgeCommit message (Collapse)Author
2017-12-14[WebAssembly] Add support for init functions linking metadataSam Clegg
Summary: This change lays the groundwork lowering of @llvm.global_ctors and @llvm.global_dtors for the wasm object format. Some parts of this patch are subset of: https://reviews.llvm.org/D40759 See https://github.com/WebAssembly/tool-conventions/issues/25 Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish Differential Revision: https://reviews.llvm.org/D41208 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320742 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[WebAssembly] Use bitfield types in wasm YAML representationSam Clegg
Differential Revision: https://reviews.llvm.org/D41202 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320642 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[WebAssembly] Add linking metatdata test coverage for wasm2yamlSam Clegg
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish Differential Revision: https://reviews.llvm.org/D41196 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320639 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06Update obj2yaml and yaml2obj for .debug$H section.Zachary Turner
Differential Revision: https://reviews.llvm.org/D40842 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319925 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-03[ObjectYAML] Handle SHF_COMPRESSEDShoaib Meenai
This was previously being silently dropped by obj2yaml and caused parsing errors with yaml2obj. Differential Revision: https://reviews.llvm.org/D38490 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314768 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-29[WebAssembly] Allow each data segment to specify its own alignmentSam Clegg
Also, add a flags field as we will almost certainly be needing that soon too. Differential Revision: https://reviews.llvm.org/D38296 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314534 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-01[WebAssembly] Update relocation names to match specSam Clegg
Summary: See https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md Differential Revision: https://reviews.llvm.org/D37385 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312342 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-31[WebAssembly] Validate exports when parsing object filesSam Clegg
Subscribers: jfb, dschuff, jgravelle-google, aheejin Differential Revision: https://reviews.llvm.org/D37358 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312286 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-17[codeview] Fix YAML for LF_TYPESERVER2 by hoisting PDB_UniqueIdReid Kleckner
Summary: We were treating the GUIDs in TypeServer2Record as strings, and the non-ASCII bytes in the GUID would not round-trip through YAML. We already had the PDB_UniqueId type portably represent a Windows GUID, but we need to hoist that up to the DebugInfo/CodeView library so that we can use it in the TypeServer2Record as well as in PDB parsing code. Reviewers: inglorion, amccarth Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D35495 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308234 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12[WebAssembly] Expose the offset of each data segmentSam Clegg
Summary: This allows tools like lld that process relocations to apply data relocation correctly. This information is required because relocation are stored as section offset. Subscribers: jfb, dschuff, jgravelle-google, aheejin Differential Revision: https://reviews.llvm.org/D35234 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307741 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27[WebAssembly] Add data size and alignement to linking sectionSam Clegg
The overal size of the data section (including BSS) is otherwise not included in the wasm binary. Differential Revision: https://reviews.llvm.org/D34657 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306459 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-20[WebAssembly] Add support for weak symbols in the binary formatSam Clegg
This also introduces the updated format for the "linking" section which can represent extra symbol information. See: https://github.com/WebAssembly/tool-conventions/pull/10 Differential Revision: https://reviews.llvm.org/D34019 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305769 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-16obj2yaml: Improve error reportingSam Clegg
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305609 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-09[WebAssembly] Improve libObject support for wasm imports and exportsSam Clegg
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302601 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-09[WebAssembly] Fix validation of start functionSam Clegg
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302560 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05[WebAssembly] Add ObjectYAML support for wasm name sectionSam Clegg
Differential Revision: https://reviews.llvm.org/D32841 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302266 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26[WebAssembly] Allow for signed relocation addendsSam Clegg
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301369 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-25[WebAssembly] Read global index in init expression as LEBSam Clegg
Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32462 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301330 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14[Test commit] Cleanup some whitespace in a test fileSam Clegg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300361 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-04Align all scalar numbers to LLVM_YAML_IS_FLOW_SEQUENCE_VECTORJonas Hahnfeld
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299415 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30[WebAssembly] Improve support for WebAssembly binary formatDerek Schuff
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299101 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07[ObjectYAML] Fix issue with DWARF2 AddrSize 8Chris Bieneman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297230 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07[ObjectYAML] Add support for DWARF5 Unit headerChris Bieneman
In DWARF5 the Unit header added a new field, UnitType, and swapped the order of the address size and abbreviation offset fields. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297183 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-06[ObjectYAML] Support for DW_FORM_implicit_const DWARF5 formChris Bieneman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297091 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-03[ObjectYAML] [DWARF] Abstract DWARF Initial Length valuesChris Bieneman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296911 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23Attempt to fix the testcase in r292824Steven Wu
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292826 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23Add LC_BUILD_VERSION load commandSteven Wu
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292824 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-19Remove this test from the r292500 commit till Chris and I figure outKevin Enderby
why it is failing on a couple of build bots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292501 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-19Add support for the new LC_NOTE load command.Kevin Enderby
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292500 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10[ObjectYAML] Missed one mixup in the debug_line testChris Bieneman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291547 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10[ObjectYAML] Support for DWARF line tablesChris Bieneman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291546 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10Revert "[ObjectYAML] Support for DWARF line tables"Chris Bieneman
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291542 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10[ObjectYAML] Support for DWARF line tablesChris Bieneman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291541 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09Revert "[ObjectYAML] Support for DWARF line tables"Chris Bieneman
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291471 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09[ObjectYAML] Support for DWARF line tablesChris Bieneman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291470 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-22[ObjectYAML] Support for DWARF debug_info sectionChris Bieneman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290386 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-22[ObjectYAML] Fixing big endian bots from r290381Chris Bieneman
Bot URL: http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/2505 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290383 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-22[ObjectYAML] MachO support for endiannessChris Bieneman
This patch adds support to the macho<->yaml tools for preserving endianness in MachO structures and DWARF data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290381 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20Revert "[ObjectYAML] Support for DWARF debug_info section"Chris Bieneman
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20[ObjectYAML] Support for DWARF debug_info sectionChris Bieneman
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!). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290204 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20Revert "[ObjectYAML] Support for DWARF debug_info section"Chris Bieneman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290148 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20[ObjectYAML] Support for DWARF debug_info sectionChris Bieneman
This patch adds support for YAML<->DWARF for debug_info sections. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19[ObjectYAML] Support for DWARF Pub SectionsChris Bieneman
This patch adds support for YAML<->DWARF round tripping for pub* section data. The patch supports both GNU and non-GNU style entries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290139 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09[ObjectYAML] Support for DWARF debug_arangesChris Bieneman
This patch adds support for round tripping DWARF debug_aranges in and out of YAML. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07[ObjectYAML] Rename DWARF entries to match section namesChris Bieneman
This change makes the yaml tags for the members of the DWARF data match the names of the DWARF sections. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288981 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07[ObjectYAML] Support for DWARF __debug_abbrev sectionChris Bieneman
This patch adds support for round-tripping DWARF debug abbreviations through the obj<->yaml tools. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288955 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06[ObjectYAML] First bit of support for encoding DWARF in MachOChris Bieneman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288774 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17[macho2yaml] Don't write empty linkedit dataChris Bieneman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278985 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-04[Mach0YAML] Change n_type from uint8_t to llvm::yaml::Hex8Chris Bieneman
Since this field is generally masked, it is way easier to understand it as a Hex value than decimal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277770 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-04[macho2yaml] String table can contain null stringsChris Bieneman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277753 91177308-0d34-0410-b5e6-96231b3b80d8