summaryrefslogtreecommitdiffstats
path: root/llvm/lib/BinaryFormat
Commit message (Collapse)AuthorAgeFilesLines
...
* DWARF: Unify form size handling codePavel Labath2018-03-141-0/+87
| | | | | | | | | | | | | | | | | Summary: This patch replaces the two switches which are deducing the size of various forms with a single implementation. I have put the new implementation into BinaryFormat, to avoid introducing dependencies between the two independent libraries (DebugInfo and CodeGen) that need this functionality. Reviewers: aprantl, JDevlieghere, dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44418 llvm-svn: 327486
* [DWARF v5] Support for verbose dumping of .debug_rnglist entriesWolfgang Pieb2018-03-081-0/+11
| | | | | | | | | | | | | | | | Adding verbose dumping to the recent implementation of dumping of v5 range list entries. We're capturing the entries as is as they come in during extraction, including their file offset, so we can dump them in more detail. The offset table entries which are table-relative are shown as is (as in non-verbose mode) and with the actual file offset they map to. Reviewers: dblaikie, aprantl, jdevlieghere, jhenderson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D43366 llvm-svn: 327059
* Fix detection of COFF executable files.Zachary Turner2018-03-081-8/+6
| | | | | | | | | | | | One overload of this function would try to identify a file by opening it and using the first 32 bytes to identify the magic of the file. This didn't work properly when more than 32 bytes is actually needed for magic detection to succeed. So now we have this overload read in the entire file. Differential Revision: https://reviews.llvm.org/D44225 llvm-svn: 327050
* Teach identify_file_magic to identify PDB files.Zachary Turner2018-03-071-1/+3
| | | | llvm-svn: 326924
* Add DWARF for discriminated unionsAdrian Prantl2018-02-061-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | n Rust, an enum that carries data in the variants is, essentially, a discriminated union. Furthermore, the Rust compiler will perform space optimizations on such enums in some situations. Previously, DWARF for these constructs was emitted using a hack (a magic field name); but this approach stopped working when more space optimizations were added in https://github.com/rust-lang/rust/pull/45225. This patch changes LLVM to allow discriminated unions to be represented in DWARF. It adds createDiscriminatedUnionType and createDiscriminatedMemberType to DIBuilder and then arranges for this to be emitted using DWARF's DW_TAG_variant_part and DW_TAG_variant. Note that DWARF requires that a discriminated union be represented as a structure with a variant part. However, as Rust only needs to emit pure discriminated unions, this is what I chose to expose on DIBuilder. Patch by Tom Tromey! Differential Revision: https://reviews.llvm.org/D42082 llvm-svn: 324426
* [Support] Move DJB hash to support. NFCJonas Devlieghere2018-01-281-6/+0
| | | | | | | | | | | This patch moves the DJB hash to support. This is consistent with other hashing algorithms living there. The hash is used by the DWARF accelerator tables. We're doing this now because the hashing function is needed by dsymutil and we don't want to link against libBinaryFormat. Differential revision: https://reviews.llvm.org/D42594 llvm-svn: 323616
* [Dwarf] Add dsymutil Atom extensions. NFCJonas Devlieghere2018-01-251-0/+3
| | | | | | | | | | This patch extends the atom types used by the Apple accelerator tables with two dsymutil extensions: - DW_ATOM_type_type_flags - DW_ATOM_qual_name_hash llvm-svn: 323414
* [NFC] Make magic number for DJB hash function customizable.Jonas Devlieghere2018-01-241-2/+1
| | | | | | | | This allows us to specify the magic number for the DJB hash function. This feature is needed by dsymutil to emit Apple types accelerator table. llvm-svn: 323341
* [BinaryFormat] Add .debug_names supportPavel Labath2018-01-221-0/+11
| | | | | | | | | | | | | | Summary: This adds a definition of the .debug_names section and the new constants (DW_IDX_???) which are used in it. Reviewers: JDevlieghere, aprantl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42296 llvm-svn: 323084
* Simplify.Rafael Espindola2017-10-191-2/+2
| | | | llvm-svn: 316144
* Fix buffer overflow.Rafael Espindola2017-10-191-1/+1
| | | | | | We were reading past the end of the buffer. llvm-svn: 316143
* llvm-dwarfdump: implement --find for .apple_namesAdrian Prantl2017-09-281-0/+7
| | | | | | | | | | | | This patch implements the dwarfdump option --find=<name>. This option looks for a DIE in the accelerator tables and dumps it if found. This initial patch only adds support for .apple_names to keep the review small, adding the other sections and pubnames support should be trivial though. Differential Revision: https://reviews.llvm.org/D38282 llvm-svn: 314439
* [BinaryFormat] Fix out of bounds read.Benjamin Kramer2017-08-311-1/+1
| | | | | | | Found by OSS-FUZZ! https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3220 llvm-svn: 312238
* Revert "Revert "Revert "Revert "Switch external cvtres.exe for llvm's own ↵Eric Beckmann2017-07-081-1/+2
| | | | | | | | | | | | | | | | | | | | resource library."""" This reverts commit 147f45ff24456aea59575fa4ac16c8fa554df46a. Revert "Revert "Revert "Revert "Replace trivial use of external rc.exe by writing our own .res file."""" This reverts commit 61a90a67ed54a1f0dfeab457b65abffa129569e4. The patches were intially reverted because they were causing a failure on CrWinClangLLD. Unfortunately, this was done haphazardly and didn't compile, so the revert was reverted again quickly to fix this. One that was done, the revert of the revert was itself reverted. This allowed me to finally fix the actual bug in r307452. This patch re-enables the code path that had originally been causing the bug, now that it (should) be fixed. llvm-svn: 307460
* Revert "Revert "Revert "Replace trivial use of external rc.exe by writing ↵Eric Beckmann2017-07-051-2/+1
| | | | | | | | | | | | | | our own .res file.""" This reverts commit 5fecbbbe5049665d86834cf69d8f75db4f392308. The initial revert was done in order to prevent ongoing errors on chromium bots such as CrWinClangLLD. However, this was done haphazardly and I didn't realize there were test and compilation failures, so this revert was reverted. Now that those have been fixed, we can revert the revert of the revert. llvm-svn: 307226
* Revert "Revert "Replace trivial use of external rc.exe by writing our own ↵Eric Beckmann2017-07-051-1/+2
| | | | | | | | .res file."" This reverts commit 8c8dce3b8f15d6ebaefc35ce88f15a85c8cdbd6e. llvm-svn: 307191
* Revert "Replace trivial use of external rc.exe by writing our own .res file."Eric Beckmann2017-07-051-2/+1
| | | | | | | | | This patch still seems to break CrWinClangLLD, reverting this once more until I can discover root problem. This reverts commit 3dbbc8ce43be50ffde2b1c655c6d3a25796fe78b. llvm-svn: 307188
* Revert "Revert "Replace trivial use of external rc.exe by writing our own ↵Eric Beckmann2017-07-011-1/+2
| | | | | | | | | | | | | | | | | | .res file."" Summary: This reverts commit 51931072a7c9a52540baf76fc30ef391d2529a2f. This revert was originally done because the integrations of the new WindowsResource library into LLD was causing error in chromium, due to bugs in how resource sections were handled. These bugs were fixed, meaning that the features may be reintegrated. Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D34922 llvm-svn: 306941
* [BinaryFormat] Identify AArch64 COFF filesMartin Storsjo2017-06-291-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D34742 llvm-svn: 306647
* Revert "Replace trivial use of external rc.exe by writing our own .res file."Eric Beckmann2017-06-291-2/+1
| | | | | | | | | | | | | | | This reverts commit d4c7e9fc63c10dbab0c30186ef8575474a704496. This is done in order to address the failure of CrWinClangLLD etc. bots. These throw an error of "side-by-side configuration is incorrect" during compilation, which sounds suspiciously related to these manifest changes. Revert "Switch external cvtres.exe for llvm's own resource library." This reverts commit 71fe8ef283a9dab9a3f21432c98466cbc23990d1. llvm-svn: 306618
* Replace trivial use of external rc.exe by writing our own .res file.Eric Beckmann2017-06-261-1/+2
| | | | | | | | | This patch removes the dependency on the external rc.exe tool by writing a simple .res file using our own library. In this patch I also added an explicit definition for the .res file magic. Furthermore, I added a unittest for embeded manifests and fixed a bug exposed by the test. llvm-svn: 306311
* Move Object format code to lib/BinaryFormat.Zachary Turner2017-06-074-0/+823
This creates a new library called BinaryFormat that has all of the headers from llvm/Support containing structure and layout definitions for various types of binary formats like dwarf, coff, elf, etc as well as the code for identifying a file from its magic. Differential Revision: https://reviews.llvm.org/D33843 llvm-svn: 304864
OpenPOWER on IntegriCloud