summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/WriterMachO.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Move Object format code to lib/BinaryFormat.Zachary Turner2017-06-071-1/+1
| | | | | | | | | | | | 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
* Fix a bunch of -Wpessimizing-move issues.Pete Cooper2016-03-311-2/+2
| | | | | | Thanks to Rui for pointing out this warning was firing. llvm-svn: 264977
* Convert lld file writing to llvm::Error. NFC.Pete Cooper2016-03-301-5/+6
| | | | | | | This converts the writeFile method, as well as some of the ones it calls in the normalized binary file writer and yaml writer. llvm-svn: 264961
* Rename ExecutableAtom.hpp to ExecutableAtom.hDavide Italiano2015-04-141-1/+1
| | | | | | This is for consistency with what's used elsewhere in lld tree. llvm-svn: 234943
* Do s/_context/_ctx/g globally.Rui Ueyama2015-04-101-11/+11
| | | | | | | | I believe this patch eliminates all remaining uses of _context or _linkingContext variable names. Consistent naming improves readability. llvm-svn: 234645
* Replace the `createImplicitFiles` method return type with `void`Simon Atanasyan2015-04-061-3/+1
| | | | | | | All instances of the `createImplicitFiles` always return `true` and this return value is used nowhere. llvm-svn: 234205
* Fix five of the shared library build targetsGreg Fitzgerald2015-01-211-1/+1
| | | | | | | | | | | | | | | | | | Before this patch there was a cyclic dependency between lldCore and lldReaderWriter. Only lldConfig could be built as a shared library. * Moved Reader and Writer base classes into lldCore. * The following shared libraries can now be built: lldCore lldYAML lldNative lldPasses lldReaderWriter Differential Revision: http://reviews.llvm.org/D7105 From: Greg Fitzgerald <garious@gmail.com> llvm-svn: 226732
* [mach-o] Support linker synthesized mach_header symbols.Nick Kledzik2014-11-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | On darwin in final linked images, the __TEXT segment covers that start of the file. That means in memory a process can see the mach_header (and load commands) for every loaded image in a process. There are APIs that take and return the mach_header addresses as a way to specify a particular loaded image. For completeness, any code can get the address of the mach_header of the image it is in by using &__dso_handle. In addition there are mach-o type specific symbols like __mh_execute_header. The linker needs to supply a definition for any of these symbols if used. But the address the symbol it resolves to is not in any section. Instead it is the address of the start of the __TEXT segment. I needed to make a small change to SimpleFileNode to not override resetNextIndex() because the Driver creates a SimpleFileNode to hold the internal/implicit files that the context/writer can create. For some reason SimpleFileNode overrode resetNextIndex() to do nothing instead of reseting the index (which mach-o needs if the internal file is an archive). llvm-svn: 221822
* [mach-o] Fix stub generation to work for dylibs and bundlesNick Kledzik2014-08-131-4/+7
| | | | | | | | | | Split up the CRuntimeFile into one part for output types that need an entry point and another part for output types that use stubs. Add file 'test/mach-o/Inputs/libSystem.yaml' for use by test cases that use -dylib and therefore may now need the helper symbol in libSystem.dylib. llvm-svn: 215602
* MachO: rename _outputFileType to avoid shadowing parent field.Tim Northover2014-06-201-1/+1
| | | | llvm-svn: 211367
* include system_error directly.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210801
* Run llvm/utils/sort_includes.py in a few files.Rafael Espindola2014-06-121-8/+4
| | | | | | This will reduce the noise in a followup patch. llvm-svn: 210800
* Don't import error_code into the lld namespace.Rafael Espindola2014-06-121-2/+2
| | | | llvm-svn: 210785
* Add -print_atoms options to DarwinLdDriver which dumps final state of all ↵Nick Kledzik2014-05-141-2/+5
| | | | | | atoms in yaml llvm-svn: 208813
* Add "override" and remove "virtual" where appropriate.Rui Ueyama2014-03-061-2/+2
| | | | | | | For the record, I used clang-modernize to add "override" and perl to remove "virtual". llvm-svn: 203164
* Fix trailing whitespace.Shankar Easwaran2014-01-271-4/+4
| | | | llvm-svn: 200182
* Use getError instead of the error_code operator.Rafael Espindola2014-01-081-2/+2
| | | | llvm-svn: 198797
* [mach-o] binary reader and writer Nick Kledzik2013-11-061-1464/+27
| | | | | | | | | | This patch adds support for converting normalized mach-o to and from binary mach-o. It also changes WriterMachO (which previously directly wrote a mach-o binary given a set of Atoms) to instead do it in two steps. The first step uses normalizedFromAtoms() to convert Atoms to normalized mach-o, and the second step uses writeBinary() which to generate the mach-o binary file. llvm-svn: 194167
* [MachO] Fix uninitialized field bug found on Windows.Rui Ueyama2013-11-021-0/+2
| | | | | | | | | | n_desc field in MachO string table was not initialized. On Unix, test/darwin/hello-world.objtxt did not fail because I think an nlist object is always allocated to a fresh heap initialized with zeros. On Windows, uninitialized fields are filled with 0xCC when compiled with /GZ. Because of that the test was failing on Windows. llvm-svn: 193909
* [lld][InputGraph] Change the Resolver to use inputGraphShankar Easwaran2013-10-071-16/+17
| | | | | | | | | | | | Changes :- a) Functionality in InputGraph to insert Input elements at any position b) Functionality in the Resolver to use nextFile c) Move the functionality of assigning file ordinals to InputGraph d) Changes all inputs to MemoryBuffers e) Remove LinkerInput, InputFiles, ReaderArchive llvm-svn: 192081
* add InputGraph functionalityShankar Easwaran2013-08-211-3/+4
| | | | llvm-svn: 188958
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-061-67/+58
| | | | | | | | | Also change some local variable names: "ti" -> "context" and "_targetInfo" -> "_context". Differential Revision: http://llvm-reviews.chandlerc.com/D1301 llvm-svn: 187823
* Fix unused field warning.Rui Ueyama2013-06-221-21/+10
| | | | llvm-svn: 184651
* Removed unnecessary "class" keyword.Rui Ueyama2013-06-211-14/+17
| | | | llvm-svn: 184589
* Remove unreachable statement.Rui Ueyama2013-05-261-3/+0
| | | | llvm-svn: 182714
* This is my Driver refactoring patch. Nick Kledzik2013-04-041-44/+25
| | | | | | | | | | | | | | | | | | | | | | | The major changes are: 1) LinkerOptions has been merged into TargetInfo 2) LinkerInvocation has been merged into Driver 3) Drivers no longer convert arguments into an intermediate (core) argument list, but instead create a TargetInfo object and call setter methods on it. This is only how in-process linking would work. That is, you can programmatically set up a TargetInfo object which controls the linking. 4) Lots of tweaks to test suite to work with driver changes 5) Add the DarwinDriver 6) I heavily doxygen commented TargetInfo.h Things to do after this patch is committed: a) Consider renaming TargetInfo, given its new roll. b) Consider pulling the list of input files out of TargetInfo. This will enable in-process clients to create one TargetInfo the re-use it with different input file lists. c) Work out a way for Drivers to format the warnings and error done in core linking. llvm-svn: 178776
* [lld] remove trailing whitespaceShankar Easwaran2013-03-141-20/+20
| | | | llvm-svn: 177079
* [Core,Driver,ELF] Differentiate static and dynamic executables.Michael J. Spencer2013-02-141-2/+7
| | | | | | | This also adds a simple relocation change for dynamic executables to x86-64 ELF. llvm-svn: 175208
* Add PassManager.Michael J. Spencer2013-01-231-17/+1
| | | | | | It owns and manages passes. llvm-svn: 173287
* Move everything over to TargetInfo.Michael J. Spencer2013-01-231-66/+66
| | | | | | | | I really would have liked to split this patch up, but it would greatly complicate the lld-core and lld drivers having to deal with both {Reader,Writer}Option and TargetInfo. llvm-svn: 173217
* rename dylibNamesToOrdinal now that it is an ivarNick Kledzik2012-11-011-6/+6
| | | | llvm-svn: 167254
* [MachO] Fix use after free.Michael J. Spencer2012-11-011-1/+1
| | | | llvm-svn: 167245
* ELF support for LLD writer. The writer at present emits ELF header and section Hemant Kulkarni2012-09-141-4/+1
| | | | | | | | | | table header. Skeleton code for ReferenceKinds. Credits: Doxygen by Michael Spencer. Origianl implementation from Macho by Sidney Manning. Templatization, implementation of section header chunks, string table, ELF header by Hemant Kulkarni. llvm-svn: 163906
* Move implementation of WriterOptionsMachO to its own file. Reduced redundantNick Kledzik2012-06-111-58/+45
| | | | | | | | ivars in WriterOptionsMachO instead have its methods compute ivar interactions. Refactor mach-o Reference Kinds and introduce abstract class KindHandler. Split up StubAtoms.hpp by architecture. Add support for 32-bit x86 stubs. llvm-svn: 158336
* abstract load commands to that WriterMachO can write 64-bit and 32-bit ↵Nick Kledzik2012-06-071-41/+74
| | | | | | mach-o files llvm-svn: 158133
* Major refactoring: Remove Platform concept. In its place there are Nick Kledzik2012-05-311-0/+1533
now Reader and Writer subclasses for each file format. Each Reader and Writer subclass defines an "options" class which controls how that Reader or Writer operates. llvm-svn: 157774
OpenPOWER on IntegriCloud