summaryrefslogtreecommitdiffstats
path: root/llvm/tools/dsymutil/dsymutil.h
Commit message (Collapse)AuthorAgeFilesLines
* [dsymutil] Pass LinkOptions by value instead of const ref.Jonas Devlieghere2019-07-301-1/+1
| | | | | | | | | | | | | When looping over the difference architectures in a fat binary, we modify the link options before dispatching the link step to a different thread. Passing the options by cont reference is not thread safe, as we might modify its fields before the whole sturct is copied over. Given that the link options are already stored in the DwarfLinker, we can easily fix this by passing a copy of the link options instead of a reference, which would just get copied later on. llvm-svn: 367348
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [dsymutil] Make the CachedBinaryHolder the defaultJonas Devlieghere2018-06-291-2/+2
| | | | | | | | Replaces all uses of the old binary holder with its cached variant. Differential revision: https://reviews.llvm.org/D48770 llvm-svn: 335991
* [dsymutil] Introduce a new CachedBinaryHolderJonas Devlieghere2018-06-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | The original binary holder has an optimization where it caches a static library (archive) between consecutive calls to GetObjects. However, the actual memory buffer wasn't cached between calls. This made sense when dsymutil was processing objects one after each other, but when processing them in parallel, several binaries have to be in memory at the same time. For this reason, every link context contained a binary holder. Having one binary holder per context is problematic, because the same static archive was cached for every object file. Luckily, when the file is mmap'ed, this was only costing us virtual memory. This patch introduces a new BinaryHolder variant that is fully cached, for all the object files it load, as well as the static archives. This way, we don't have to give up on this optimization of bypassing the file system. Differential revision: https://reviews.llvm.org/D48501 llvm-svn: 335990
* [dsymutil] Move abstractions into separate files (NFC)Jonas Devlieghere2018-06-271-32/+2
| | | | | | | | | | | This patch splits off some abstractions used by dsymutil's dwarf linker and moves them into separate header and implementation files. This almost halves the number of LOC in DwarfLinker.cpp and makes it a lot easier to understand what functionality lives where. Differential revision: https://reviews.llvm.org/D48647 llvm-svn: 335749
* [dsymutil] Apply recursion workaround for threadingJonas Devlieghere2018-04-031-0/+3
| | | | | | | | | | | | The DwarfLinker can have some very deep recursion that can max out the (significantly smaller) stack when using threads. We don't want this limitation when we only have a single thread. We already have this workaround for the architecture-related threading. This patch applies the same workaround to the parallel analysis and cloning. Differential revision: https://reviews.llvm.org/D45172 llvm-svn: 329093
* [dsymutil] Upstream emitting of papertrail warnings.Jonas Devlieghere2018-04-021-1/+2
| | | | | | | | | | When running dsymutil as part of your build system, it can be desirable for warnings to be part of the end product, rather than just being emitted to the output stream. This patch upstreams that functionality. Differential revision: https://reviews.llvm.org/D44639 llvm-svn: 328965
* [dsymutil] Unify error handling and add colorJonas Devlieghere2018-03-091-2/+2
| | | | | | | | | We improved the handling of errors and warnings in dwarfdump's verifier in rL314498. This patch does the same thing for dsymutil. Differential revision: https://reviews.llvm.org/D44052 llvm-svn: 327137
* [dsymutil] Remove \brief from comments. NFCJonas Devlieghere2018-02-221-5/+4
| | | | | | | With autobrief enabled, these server no purpose anymore. Most of them were already removed but this makes everything consistent. llvm-svn: 325769
* [dsymutil] Fix typos and formatting. NFC.Jonas Devlieghere2018-02-221-1/+1
| | | | | | | Some over-due gardening: this fixes a bunch of typos and makes the formatting consistent with LLVM's style guide. llvm-svn: 325768
* Re-land [dsymutil] Upstream update featureJonas Devlieghere2018-02-081-1/+4
| | | | | | | | | | This commit attempts to re-land the r324480 which was reverted in r324493 because it broke the Windows bots. For now I disabled the two update tests on Windows until I'm able to debug this. Differential revision: https://reviews.llvm.org/D42880 llvm-svn: 324592
* Revert dsymutil -update commitsJonas Devlieghere2018-02-071-4/+1
| | | | | | | Revert "[dsymutil][test] Check the updated dSYM instead of companion file." Revert "[dsymutil] Upstream update feature." llvm-svn: 324493
* [dsymutil] Upstream update feature.Jonas Devlieghere2018-02-071-1/+4
| | | | | | | | | | | Now that dsymutil can generate accelerator tables, we can upstream the update logic that, as the name implies, updates the accelerator tables in an existing dSYM bundle. In combination with `-minimize` this can be used to remove redundant .debug_(inlines|pubtypes|pubnames). Differential revision: https://reviews.llvm.org/D42880 llvm-svn: 324480
* [dsymutil] Generate Apple accelerator tablesJonas Devlieghere2018-01-291-0/+3
| | | | | | | | | | | This patch adds support for generating accelerator tables in dsymutil. This feature was already present in our internal repository but not yet upstreamed because it requires changes to the Apple accelerator table implementation. Differential revision: https://reviews.llvm.org/D42501 llvm-svn: 323655
* make exitDsymutil static.Rafael Espindola2017-11-161-4/+0
| | | | | | | | | The objective is to remove it completelly. This first patch removes the last use outside dsymutil.cpp and makes it static. llvm-svn: 318429
* Simplify file handling in dsymutil.Rafael Espindola2017-11-151-1/+1
| | | | | | | | | | | This moves the file handling out of DwarfLinker.cpp. This fixes what is at least an oddity if not a bug. DwarfLinker.cpp was using ToolOutputFile, which uses RemoveFileOnSignal. The issue is that dsymutil.cpp uses that too. It is now clear from the interface that only dsymutil.cpp is responsible for creating and deleting files. llvm-svn: 318334
* [dsymutil, llvm-objcopy] Fix some Clang-tidy modernize and Include What You ↵Eugene Zelenko2017-11-011-11/+27
| | | | | | Use warnings; other minor fixes (NFC). llvm-svn: 317123
* Re-land "[dsymutil] Timestmap verification for __swift_ast"Jonas Devlieghere2017-10-131-4/+5
| | | | | | | | | | This patch adds timestamp verification for swiftmodule files. A new flag is provided to allows us to disable this check in order to allow testing of this feature. Differential revision: https://reviews.llvm.org/D38686 llvm-svn: 315684
* Revert "[dsymutil] Timestmap verification for __swift_ast"Jonas Devlieghere2017-10-111-5/+4
| | | | | | This reverts commit r315456. llvm-svn: 315458
* [dsymutil] Timestmap verification for __swift_astJonas Devlieghere2017-10-111-4/+5
| | | | | | | | | | | | This patch adds timestamp verification for swiftmodule files. - A new flag is provided to allows us to continue testing of the code for embedding the__swift_ast. (git doesn't maintain timestamps) - Adds a new test for fat (arm) binaries. Differential revision: https://reviews.llvm.org/D38686 llvm-svn: 315456
* dsymutil: Fix a comment. [-Wdocumentation]NAKAMURA Takumi2015-09-231-1/+1
| | | | llvm-svn: 248353
* dsymutil: Make -oso-prepend-path available to DwarfLinker.Adrian Prantl2015-09-221-0/+1
| | | | | | NFC llvm-svn: 248312
* [dsymutil] Implement -symtab/-s option.Frederic Riss2015-08-311-0/+4
| | | | | | | This option dumps the STAB entries that define the debug map(s) stored in the input binaries, and then exits. llvm-svn: 246403
* [dsymutil] Make the warn and error helpers globally available. NFC.Frederic Riss2015-08-261-0/+3
| | | | llvm-svn: 246010
* [dsymutil] Add support for the -arch option.Frederic Riss2015-08-051-2/+2
| | | | | | | | This option allows to select a subset of the architectures when performing a universal binary link. The filter is done completely in the mach-o specific part of the code. llvm-svn: 244160
* [dsymutil] Implement support for handling mach-o universal binaries as main ↵Frederic Riss2015-08-051-7/+6
| | | | | | | | | | | | | | | | | input/output. The DWARF linker isn't touched by this, the implementation links individual files and merges them together into a fat binary by calling out to the 'lipo' utility. The main change is that the MachODebugMapParser can now return multiple debug maps for a single binary. The test just verifies that lipo would be invoked correctly, but doesn't actually generate a binary. This mimics the way clang tests its external iplatform tools integration. llvm-svn: 244087
* [dsymutil] Introduce exit helper. NFC.Frederic Riss2015-08-051-0/+5
| | | | | | | | llvm-dsymutil will start creating temporary files in a followup commit. To ease the correct cleanup of this files, introduce a helper called to exit dsymutil. llvm-svn: 244086
* [dsymutil] Implement ODR uniquing for C++ code.Frederic Riss2015-07-211-0/+1
| | | | | | | | | | | | | | | | | This optimization allows the DWARF linker to reuse definition of types it has emitted in previous CUs rather than reemitting them in each CU that references them. The size and link time gains are huge. For example when linking the DWARF for a debug build of clang, this generates a ~150M dwarf file instead of a ~700M one (the numbers date back a bit and must not be totally accurate these days). As with all the other parts of the llvm-dsymutil codebase, the goal is to keep bit-for-bit compatibility with dsymutil-classic. The code is littered with a lot of FIXMEs that should be addressed once we can get rid of the compatibilty goal. llvm-svn: 242847
* [dsymutil] Apply clang-format. NFCFrederic Riss2015-06-051-3/+4
| | | | llvm-svn: 239186
* Reapply r238941 - [dsymutil] Accept a YAML debug map as input instead of a ↵Frederic Riss2015-06-031-2/+2
| | | | | | | | | | | | | | | | | | | | | binary. With a couple more constructors that GCC thinks are necessary. Original commit message: [dsymutil] Accept a YAML debug map as input instead of a binary. To do this, the user needs to pass the new -y flag. As it wasn't tested before, the debug map YAML deserialization was completely buggy (mainly because the DebugMapObject has a dual mapping that allows to search by name and by address, but only the StringMap got populated). It's fixed and tested in this commit by augmenting some test with a 2 stage dwarf link: a frist llvm-dsymutil reads the debug map and pipes it in a second instance that does the actual link without touching the initial binary. llvm-svn: 238959
* Revert "[dsymutil] Accept a YAML debug map as input instead of a binary."Frederic Riss2015-06-031-2/+2
| | | | | | This reverts commit r238941 while I figure out the bot issues. llvm-svn: 238943
* [dsymutil] Accept a YAML debug map as input instead of a binary.Frederic Riss2015-06-031-2/+2
| | | | | | | | | | | | | To do this, the user needs to pass the new -y flag. As it wasn't tested before, the debug map YAML deserialization was completely buggy (mainly because the DebugMapObject has a dual mapping that allows to search by name and by address, but only the StringMap got populated). It's fixed and tested in this commit by augmenting some test with a 2 stage dwarf link: a frist llvm-dsymutil reads the debug map and pipes it in a second instance that does the actual link without touching the initial binary. llvm-svn: 238941
* [dsymutil] Add the DwarfStreamer class.Frederic Riss2015-02-281-2/+3
| | | | | | | | | | | | | | | | | | | | This class is responsible for getting the linked data to the disk in the appropriate form. Today it it an empty shell that just instantiates an MC layer. As we do not put anything in the resulting file yet, we just check it has the right architecture (and check that -o does the right thing). To be able to create all the components, this commit adds a few dependencies to llvm-dsymutil, namely all-targets, MC and AsmPrinter. Also add a -no-output option, so that tests that do not need the binary result can continue to run even if they do not have the required target linked in. llvm-svn: 230824
* [dsymutil] Add a LinkOptions struct to pass to the DwarfLinker. NFC.Frederic Riss2015-02-281-1/+8
| | | | | | | The only option we have to pass down currently is verbosity, but there are more to come. llvm-svn: 230823
* [dsymutil] Pass the verbosity flag down to the processing. NFC for now.Frederic Riss2014-12-161-2/+4
| | | | llvm-svn: 224361
* Initial dsymutil tool commit.Frederic Riss2014-12-121-0/+37
The goal of this tool is to replicate Darwin's dsymutil functionality based on LLVM. dsymutil is a DWARF linker. Darwin's linker (ld64) does not link the debug information, it leaves it in the object files in relocatable form, but embbeds a `debug map` into the executable that describes where to find the debug information and how to relocate it. When releasing/archiving a binary, dsymutil is called to link all the DWARF information into a `dsym bundle` that can distributed/stored along with the binary. With this commit, the LLVM based dsymutil is just able to parse the STABS debug maps embedded by ld64 in linked binaries (and not all of them, for example archives aren't supported yet). Note that the tool directory is called dsymutil, but the executable is currently called llvm-dsymutil. This discrepancy will disappear once the tool will be feature complete. At this point the executable will be renamed to dsymutil, but until then you do not want it to override the system one. Differential Revision: http://reviews.llvm.org/D6242 llvm-svn: 224134
OpenPOWER on IntegriCloud