aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ObjectYAML
AgeCommit message (Collapse)AuthorFilesLines
2020-03-06[lib/ObjectYAML] - Make `ELFYAML::Relocation::Offset` optional.Georgii Rymar1-1/+1
Currently `yaml2obj` require `Offset` field in a relocation description. There are many cases when `Offset` is insignificant in a context of a test case. Making `Offset` optional allows to simplify our test cases. This is what this patch does. Also, with this patch `obj2yaml` does not dump a zero offset of a relocation. Differential revision: https://reviews.llvm.org/D75608
2020-02-25[yaml2obj] - Address post commit comments for D74764Georgii Rymar1-2/+0
It removes a stale comment and fixes the comment in the test and section names related accordingly.
2020-02-22[yaml2obj] - Automatically assign sh_addr for allocatable sections.Georgii Rymar2-5/+35
I've noticed that it is not convenient to create YAMLs from binaries (using obj2yaml) that have to be test cases for obj2yaml later (after applying yaml2obj). The problem, for example is that obj2yaml emits "DynamicSymbols:" key instead of .dynsym. It also does not create .dynstr. And when a YAML document without explicitly defined .dynsym/.dynstr is given to yaml2obj, we have issues: 1) These sections are placed after non-allocatable sections (I've fixed it in D74756). 2) They have VA == 0. User needs create descriptions for such sections explicitly manually to set a VA. This patch addresses (2). I suggest to let yaml2obj assign virtual addresses by itself. It makes an output binary to be much closer to "normal" ELF. (It is still possible to use "Address: 0x0" for a section to get the original behavior if it is needed) Differential revision: https://reviews.llvm.org/D74764
2020-02-19[yaml2obj] - Change the order of implicitly created sections.Georgii Rymar1-3/+2
.dynsym and .dynstr are allocatable and therefore normally are placed before non-allocatable .strtab, .shstrtab, .symtab sections. But we are placing them after currently what creates a mix of alloc/non-alloc sections and does not look normal. Differential revision: https://reviews.llvm.org/D74756
2020-02-10Revert "Remove redundant "std::move"s in return statements"Bill Wendling4-8/+8
The build failed with error: call to deleted constructor of 'llvm::Error' errors. This reverts commit 1c2241a7936bf85aa68aef94bd40c3ba77d8ddf2.
2020-02-10Remove redundant "std::move"s in return statementsBill Wendling4-8/+8
2020-02-06[yaml2obj] - Change NameIndex to StName for Symbol.Georgii Rymar2-5/+3
It is consistent with the approach we use for Section struct. Differential revision: https://reviews.llvm.org/D74034
2020-02-05[yaml2obj][obj2yaml] - Simplify format of the SHT_LLVM_ADDRSIG section.Georgii Rymar2-17/+3
Previously the description allowed to describe symbols with use of `Name` and `Index` keys. This patch removes them and now it is still possible to use either names or symbol indexes, but the code is simpler and the format is slightly different. Such a change will be useful for another patches, e.g: https://reviews.llvm.org/D73788#inline-671077 Differential revision: https://reviews.llvm.org/D73888
2020-02-04[yaml2obj/obj2yaml] - Add support for the SHT_LLVM_CALL_GRAPH_PROFILE section.Georgii Rymar2-0/+65
This is a LLVM specific section that is well described here: https://llvm.org/docs/Extensions.html#sht-llvm-call-graph-profile-section-call-graph-profile This patch teaches yaml2obj and obj2yaml about how to work with it. Differential revision: https://reviews.llvm.org/D73788
2020-01-30[yaml2obj] - Add a way to set sh_entsize for relocation sections.Georgii Rymar1-2/+6
We are missing ability to override the sh_entsize field for SHT_REL[A] sections. It would be useful for writing test cases. Differential revision: https://reviews.llvm.org/D73621
2020-01-21[Hexagon] Add support for Hexagon v67t microarchitecture (tiny core)Krzysztof Parzyszek1-0/+1
2020-01-20[Hexagon] Add support for Hexagon/HVX v67 ISAKrzysztof Parzyszek1-0/+2
2020-01-16[Hexagon] Add ELF flags for Hexagon v66 to ELFYAML.cppKrzysztof Parzyszek1-0/+2
2020-01-15[yaml2obj/obj2yaml] - Add support for SHT_RELR sections.Georgii Rymar2-7/+50
Note: this is a reland with a trivial 2 lines fix in ELFState<ELFT>::writeSectionContent. It adds a check similar to ones we already have for other sections to fix the case revealed by bots, like http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/60744. 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
2020-01-15Revert "[yaml2obj/obj2yaml] - Add support for SHT_RELR sections."Georgii Rymar2-47/+7
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
2020-01-15[yaml2obj/obj2yaml] - Add support for SHT_RELR sections.Georgii Rymar2-7/+47
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
2020-01-01[NFC] Fixes -Wrange-loop-analysis warningsMark de Wever1-1/+1
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D71857
2019-12-23[yaml2obj] - Allow using an arbitrary value for OSABI.Georgii Rymar1-0/+1
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
2019-12-23[yaml2obj] - Add support for ELFOSABI_LINUX.Georgii Rymar1-0/+1
ELFOSABI_LINUX is an alias for ELFOSABI_GNU. It is not that obvious probably. Differential revision: https://reviews.llvm.org/D71764
2019-12-13[yaml2obj] - Add a way to override sh_flags section field.Georgii Rymar2-22/+24
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
2019-12-04[ELF] Support for PT_GNU_PROPERTY in header and toolsPeter Smith1-0/+1
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
2019-12-04[yaml2obj] - Make DynamicSymbols to be Optional<> too.Georgii Rymar1-16/+21
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
2019-11-29[yaml2obj] - Add a way to describe content of the SHT_GNU_verneed section ↵Georgii Rymar2-10/+28
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
2019-11-26[yaml2obj] - Teach tool to describe SHT_GNU_verdef section with a "Content" ↵Georgii Rymar2-9/+27
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
2019-11-25[yaml2obj/obj2yaml] - Add support for SHT_LLVM_DEPENDENT_LIBRARIES sections.Georgii Rymar2-0/+66
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
2019-11-21[cmake] Explicitly mark libraries defined in lib/ as "Component Libraries"Tom Stellard1-1/+1
Summary: Most libraries are defined in the lib/ directory but there are also a few libraries defined in tools/ e.g. libLLVM, libLTO. I'm defining "Component Libraries" as libraries defined in lib/ that may be included in libLLVM.so. Explicitly marking the libraries in lib/ as component libraries allows us to remove some fragile checks that attempt to differentiate between lib/ libraries and tools/ libraires: 1. In tools/llvm-shlib, because llvm_map_components_to_libnames(LIB_NAMES "all") returned a list of all libraries defined in the whole project, there was custom code needed to filter out libraries defined in tools/, none of which should be included in libLLVM.so. This code assumed that any library defined as static was from lib/ and everything else should be excluded. With this change, llvm_map_components_to_libnames(LIB_NAMES, "all") only returns libraries that have been added to the LLVM_COMPONENT_LIBS global cmake property, so this custom filtering logic can be removed. Doing this also fixes the build with BUILD_SHARED_LIBS=ON and LLVM_BUILD_LLVM_DYLIB=ON. 2. There was some code in llvm_add_library that assumed that libraries defined in lib/ would not have LLVM_LINK_COMPONENTS or ARG_LINK_COMPONENTS set. This is only true because libraries defined lib lib/ use LLVMBuild.txt and don't set these values. This code has been fixed now to check if the library has been explicitly marked as a component library, which should now make it easier to remove LLVMBuild at some point in the future. I have tested this patch on Windows, MacOS and Linux with release builds and the following combinations of CMake options: - "" (No options) - -DLLVM_BUILD_LLVM_DYLIB=ON - -DLLVM_LINK_LLVM_DYLIB=ON - -DBUILD_SHARED_LIBS=ON - -DBUILD_SHARED_LIBS=ON -DLLVM_BUILD_LLVM_DYLIB=ON - -DBUILD_SHARED_LIBS=ON -DLLVM_LINK_LLVM_DYLIB=ON Reviewers: beanz, smeenai, compnerd, phosek Reviewed By: beanz Subscribers: wuzish, jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, mgorny, mehdi_amini, sbc100, jgravelle-google, hiraditya, aheejin, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, steven_wu, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, jocewei, jsji, dang, Jim, lenary, s.egerton, pzheng, sameer.abuasal, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70179
2019-11-20Recommit "[DWARF] Add an api to get "interpreted" location lists"Pavel Labath1-1/+4
This recommits 089c0f581492cd6e2a3d2927be3fbf60ea2d7e62, which was reverted due to failing tests on big endian machines. It includes a fix which I believe (I don't have BE machine) should fix this issue. The fix consists of correcting the invocation DWARFYAML::EmitDebugSections, which was missing one (default) function arguments, and so didn't actually force the little-endian mode. The original commit message follows. Summary: This patch adds DWARFDie::getLocations, which returns the location expressions for a given attribute (typically DW_AT_location). It handles both "inline" locations and references to the external location list sections (currently only of the DW_FORM_sec_offset type). It is implemented on top of DWARFUnit::findLoclistFromOffset, which is also added in this patch. I tried to make their signatures similar to the equivalent range list functionality. The actual location list interpretation logic is in DWARFLocationTable::visitAbsoluteLocationList. This part is not equivalent to the range list code, but this deviation is motivated by a desire to reuse the same location list parsing code within lldb. The functionality is tested via a c++ unit test of the DWARFDie API. Reviewers: dblaikie, JDevlieghere, SouraVX Subscribers: mgorny, hiraditya, cmtice, probinson, llvm-commits, aprantl Tags: #llvm Differential Revision: https://reviews.llvm.org/D70394
2019-11-20Revert "[DWARF] Add an api to get "interpreted" location lists"Pavel Labath1-4/+1
The test fails on big endian machines. This reverts commit 089c0f581492cd6e2a3d2927be3fbf60ea2d7e62 and the subsequent attempt to fix in 82dc32e2d456c75d08bc9ffe97def409ee5a03cd.
2019-11-20[DWARF] Add an api to get "interpreted" location listsPavel Labath1-1/+4
Summary: This patch adds DWARFDie::getLocations, which returns the location expressions for a given attribute (typically DW_AT_location). It handles both "inline" locations and references to the external location list sections (currently only of the DW_FORM_sec_offset type). It is implemented on top of DWARFUnit::findLoclistFromOffset, which is also added in this patch. I tried to make their signatures similar to the equivalent range list functionality. The actual location list interpretation logic is in DWARFLocationTable::visitAbsoluteLocationList. This part is not equivalent to the range list code, but this deviation is motivated by a desire to reuse the same location list parsing code within lldb. The functionality is tested via a c++ unit test of the DWARFDie API. Reviewers: dblaikie, JDevlieghere, SouraVX Subscribers: mgorny, hiraditya, cmtice, probinson, llvm-commits, aprantl Tags: #llvm Differential Revision: https://reviews.llvm.org/D70394
2019-11-14[yaml2obj][COFF] Add support for extended relocation tablesSergey Dmitriev1-3/+10
Summary: The tool does not correctly handle COFF sections with extended relocation tables (with IMAGE_SCN_LNK_NRELOC_OVFL bit set), this patch fixes this problem. But I have cheated a bit in the test (to make it smaller) because extended relocation table is supposed to be used when the number of relocations exceeds 65534. Otherwise the test size would be pretty big. Reviewers: jhenderson, MaskRay, mstorsjo Reviewed By: mstorsjo Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70251
2019-11-12[yaml2obj/obj2yaml] - Add support for SHT_LLVM_LINKER_OPTIONS sections.Georgii Rymar2-0/+53
SHT_LLVM_LINKER_OPTIONS section contains pairs of null-terminated strings. This patch adds support for them. Differential revision: https://reviews.llvm.org/D69895
2019-11-11Remove superfluous ';' to fix Wpedantic. NFC.Simon Pilgrim1-1/+1
2019-11-11[FixBB] - Fix one more std::min -> std::min<uint64_t> to make BB happy.Georgii Rymar1-1/+1
BB: http://lab.llvm.org:8011/builders/clang-armv7-linux-build-cache/builds/22133/steps/build%20stage%201/logs/stdio
2019-11-11[FixBB] - An attemp to fix clang-armv7-linux-build-cache builder.Georgii Rymar1-1/+2
http://lab.llvm.org:8011/builders/clang-armv7-linux-build-cache/builds/22130/steps/build%20stage%201/logs/stdio /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/ObjectYAML -I/home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/lib/ObjectYAML -I/usr/include/libxml2 -Iinclude -I/home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/include -mthumb -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -UNDEBUG -fno-exceptions -fno-rtti -std=c++14 -MMD -MT lib/ObjectYAML/CMakeFiles/LLVMObjectYAML.dir/YAML.cpp.o -MF lib/ObjectYAML/CMakeFiles/LLVMObjectYAML.dir/YAML.cpp.o.d -o lib/ObjectYAML/CMakeFiles/LLVMObjectYAML.dir/YAML.cpp.o -c /home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/lib/ObjectYAML/YAML.cpp /home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/lib/ObjectYAML/YAML.cpp:42:41: error: no matching function for call to 'min' OS.write((const char *)Data.data(), std::min(N, Data.size())); ^~~~~~~~ /usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/bits/algorithmfwd.h:370:5: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('unsigned long long' vs. 'unsigned int') min(const _Tp&, const _Tp&); ^ /usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/bits/stl_algo.h:3451:5: note: candidate template ignored: could not match 'initializer_list<type-parameter-0-0>' against 'unsigned long long' min(initializer_list<_Tp> __l, _Compare __comp) ^ /usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/bits/algorithmfwd.h:375:5: note: candidate function template not viable: requires 3 arguments, but 2 were provided min(const _Tp&, const _Tp&, _Compare); ^ /usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/bits/stl_algo.h:3445:5: note: candidate function template not viable: requires single argument '__l', but 2 arguments were provided min(initializer_list<_Tp> __l) ^ /home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/lib/ObjectYAML/YAML.cpp:46:28: error: no matching function for call to 'min' for (uint64_t I = 0, E = std::min(N, Data.size() / 2); I != E; ++I) { ^~~~~~~~ /usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/bits/algorithmfwd.h:370:5: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('unsigned long long' vs. 'unsigned int') min(const _Tp&, const _Tp&); ^ /usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/bits/stl_algo.h:3451:5: note: candidate template ignored: could not match 'initializer_list<type-parameter-0-0>' against 'unsigned long long' min(initializer_list<_Tp> __l, _Compare __comp) ^ /usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/bits/algorithmfwd.h:375:5: note: candidate function template not viable: requires 3 arguments, but 2 were provided min(const _Tp&, const _Tp&, _Compare); ^ /usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/bits/stl_algo.h:3445:5: note: candidate function template not viable: requires single argument '__l', but 2 arguments were provided min(initializer_list<_Tp> __l) Fix: specify the type for std::min call.
2019-11-11[yaml2obj] - Add a way to describe the custom data that is not part of an ↵Georgii Rymar3-68/+173
output section. Currently there is no way to describe the data that is not a part of an output section. It can be a data used to align sections or to fill the gaps with something, or another kind of custom data. In this patch I suggest a way to describe it. It looks like that: ``` Sections: - Type: CustomFiller Pattern: "CCDD" Size: 4 - Name: .bar Type: SHT_PROGBITS Content: "FF" ``` I.e. I've added a kind of synthetic section with a synthetic type "CustomFiller". In the code it is called a "SyntheticFiller", which is "a synthetic section which might be used to write the custom data around regular output sections. It does not present in the sections header table, but it might affect the output file size and program headers produced. Think about it as about piece of data." `SyntheticFiller` currently has a `Pattern` field and a `Size` field + an optional `Name`. When written, `Size` of bytes in the output will be filled with a `Pattern`. It is possible to reference a named filler it by name from the program headers description, just like any other normal section. Differential revision: https://reviews.llvm.org/D69709
2019-11-06Fix a typo in my previous commitSteven Wu1-1/+1
2019-11-06[Object][MachO] Rewrite macho-invalid-fat-arch-size into YAMLSteven Wu1-1/+2
Summary: Rewrite one of the invalid macho test input file with YAML file. The original invalid macho is breaking our internal test infrastusture because it is too broken to be copy around. Need to relax an assertion in the YAML/MachoEmitter to allow yaml2obj to write an invalid object like this. rdar://problem/56879982 Reviewers: beanz, mtrent Reviewed By: beanz Subscribers: hiraditya, jkorous, dexonsmith, ributzka, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69856
2019-10-31minidump: Add an "arm64" constantPavel Labath1-0/+1
This is the "official" constant for arm64. We also have another constant for arm64 (called BP_ARM64), which was used by breakpad while there was no official constant for arm64 available.
2019-10-31[yaml2obj/obj2yaml] - Add support for SHT_GNU_HASH section.georgerim2-0/+115
This adds parsing and dumping support for GNU hash sections. They are described nicely here: https://blogs.oracle.com/solaris/gnu-hash-elf-sections-v2 Differential revision: https://reviews.llvm.org/D69399
2019-10-30minidump: Rename some architecture constantsPavel Labath1-1/+1
The architecture enum contains two kinds of contstants: the "official" ones defined by Microsoft, and unofficial constants added by breakpad to cover the architectures not described by the first ones. Up until now, there was no big need to differentiate between the two. However, now that Microsoft has defined https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-system_info a constant for ARM64, we have a name clash. This patch renames all breakpad-defined constants with to include the prefix "BP_". This frees up the name "ARM64", which I'll re-introduce with the new "official" value in a follow-up patch. Reviewers: amccarth, clayborg Subscribers: lldb-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D69285
2019-10-29[yaml2obj] - Make .symtab to be not mandatory section for SHT_REL[A] section.Georgii Rymar1-10/+4
Before this change .symtab section was required for SHT_REL[A] section declarations. yaml2obj automatically defined it in case when YAML document did not have it. With this change it is now possible to produce an object that has a relocation section, but has no symbol table. It simplifies the code and also it is inline with how we handle Link fields for another special sections. Differential revision: https://reviews.llvm.org/D69260
2019-10-29[yaml2obj] - Improve handling of the SHT_GROUP section.Georgii Rymar2-3/+9
Currently, when we do not specify "Info" field in a YAML description for SHT_GROUP section, yaml2obj reports an error: "error: unknown symbol referenced: '' by YAML section '.group1'" Also, we do not link it with a symbol table by default, though it is what we do for AddrsigSection, HashSection, RelocationSection. (http://www.sco.com/developers/gabi/latest/ch4.sheader.html#sh_link) The patch fixes missings mentioned. Differential revision: https://reviews.llvm.org/D69299
2019-10-26[ObjectYAML] - Do not use auto. NFC.Georgii Rymar1-1/+1
Using 'auto' when the type is not obvious is undesired. (it is just a test commit actually)
2019-10-25[yaml2obj, obj2yaml] - Add support for SHT_NOTE sections.georgerim2-8/+102
SHT_NOTE is the section that consists of namesz, descsz, type, name + padding, desc + padding data. This patch teaches yaml2obj, obj2yaml to dump and parse them. This patch implements the section how it is described here: https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-18048.html Which says: "For 64–bit objects and 32–bit objects, each entry is an array of 4-byte words in the format of the target processor" The official specification is different http://www.sco.com/developers/gabi/latest/ch5.pheader.html#note_section And says: "n 64-bit objects (files with e_ident[EI_CLASS] equal to ELFCLASS64), each entry is an array of 8-byte words in the format of the target processor. In 32-bit objects (files with e_ident[EI_CLASS] equal to ELFCLASS32), each entry is an array of 4-byte words in the format of the target processor" Since LLVM uses the first, 32-bit way, this patch follows it. Differential revision: https://reviews.llvm.org/D68983
2019-10-23[lib/ObjectYAML] - Add a full stop to the comment. NFC.georgerim1-1/+1
A test commit.
2019-10-20[yaml2obj][obj2yaml] - Do not create a symbol table by default.George Rimar1-6/+23
This patch tries to resolve problems faced in D68943 and uses some of the code written by Konrad Wilhelm Kleine in that patch. Previously, yaml2obj tool always created a .symtab section. This patch changes that. With it we only create it when have a "Symbols:" tag in the YAML document or when we need to create it because it is used by another section(s). obj2yaml follows the new behavior and does not print "Symbols:" anymore when there is no symbol table. Differential revision: https://reviews.llvm.org/D69041 llvm-svn: 375361
2019-10-18[WebAssembly] Allow multivalue signatures in object filesThomas Lively2-8/+4
Summary: Also changes the wasm YAML format to reflect the possibility of having multiple return types and to put the returns after the params for consistency with the binary encoding. Reviewers: aheejin, sbc100 Subscribers: dschuff, jgravelle-google, hiraditya, sunfish, arphaman, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69156 llvm-svn: 375283
2019-10-18Update MinidumpYAML to use minidump::Exception for exception streamJoseph Tremoulet2-2/+67
Reviewers: labath, jhenderson, clayborg, MaskRay, grimar Reviewed By: grimar Subscribers: lldb-commits, grimar, MaskRay, hiraditya, llvm-commits Tags: #llvm, #lldb Differential Revision: https://reviews.llvm.org/D68657 llvm-svn: 375242
2019-10-10MinidumpYAML: Add support for the memory info list streamPavel Labath2-0/+59
Summary: The implementation is fairly straight-forward and uses the same patterns as the existing streams. The yaml form does not attempt to preserve the data in the "gaps" that can be created by setting a larger-than-required header or entry size in the stream header, because the existing consumer (lldb) does not make use of the information in the gap in any way, and attempting to preserve that would make the implementation more complicated. Reviewers: amccarth, jhenderson, clayborg Subscribers: llvm-commits, lldb-commits, markmentovai, zturner, JosephTremoulet Tags: #llvm Differential Revision: https://reviews.llvm.org/D68645 llvm-svn: 374337
2019-10-03[yaml2obj] - Add a Size tag support for SHT_LLVM_ADDRSIG sections.George Rimar2-6/+12
It allows using "Size" with or without "Content" in YAML descriptions of SHT_LLVM_ADDRSIG sections. Differential revision: https://reviews.llvm.org/D68334 llvm-svn: 373610