summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/ExecutableAtoms.hpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename ExecutableAtom.hpp to ExecutableAtom.hDavide Italiano2015-04-141-133/+0
| | | | | | This is for consistency with what's used elsewhere in lld tree. llvm-svn: 234943
* Rename atom_collection -> AtomVector.Rui Ueyama2015-04-081-5/+5
| | | | | | Type names should start with an uppercase letter in the LLVM coding style. llvm-svn: 234452
* Separate atom_collection type into two different types. NFC.Rui Ueyama2015-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | atom_collection is basically a wrapper for std::vector. The class provides begin and end member functions, so that it "hides" the other member functions provided by std::vector. However, you can still directly access _atoms member since the member is not protected. We cannot simply make the member private because we need that member when we are constructing atom vectors. This patch splits atom_collection into two types: std::vector<Atom *> and AtomRange. When we are constructing atom vectors, we use the former class. We return instances of the latter class from File objects so that callers cannot add or remove atoms from the lists. std::vector<Atom *> is automatically converted to AtomRange. llvm-svn: 234450
* Merge atom_collection_vector with atom_collection.Rui Ueyama2015-04-081-1/+1
| | | | | | | atom_collection_vector is the only derived class of atom_collection. This patch merges the two. llvm-svn: 234443
* MachO: Remove unused vectors from MachHeaderAliasFile. NFC.Rui Ueyama2015-04-071-6/+3
| | | | llvm-svn: 234369
* Use alignment values everywhere instead of log2.Rui Ueyama2015-03-261-1/+1
| | | | | | | | This patch defines implicit conversion between integers and PowerOf2 instances, so uses of the classes is now implicit and look like regular integers. Now we are ready to remove the scaffolding. llvm-svn: 233245
* Make File non-const in the resolver.Rui Ueyama2015-03-041-1/+1
| | | | | | | | | | | | | | | File objects are not really const in the resolver. We set ordinals to them and call beforeLink hooks. Also, File's member functions marked as const are not really const. ArchiveFile never returns the same member file twice, so it remembers files returned before. find() has side effects. In order to deal with the inconsistencies, we sprinkled const_casts and marked member varaibles as mutable. This patch removes const from there to reflect the reality. llvm-svn: 231212
* [Mach-O] Remove redundant allocatorJean-Daniel Dupas2015-02-201-2/+1
| | | | llvm-svn: 230007
* Re-commit r225674: Convert other drivers to use WrapperNode.Rui Ueyama2015-01-151-1/+1
| | | | | | | | The original commit had an issue with Mac OS dylib files. It didn't handle fat binary dylib files correctly. This patch includes a fix. A test for that case has already been committed in r225764. llvm-svn: 226123
* Revert "Convert other drivers to use WrapperNode" and subsequent commits.Rui Ueyama2015-01-141-1/+1
| | | | | | | r225764 broke a basic functionality on Mac OS. This change reverts r225764, r225766, r225767, r225769, r225814, r225816, r225829, and r225832. llvm-svn: 225859
* Convert other drivers to use WrapperNode.Rui Ueyama2015-01-131-1/+1
| | | | llvm-svn: 225764
* [mach-o] extract atom alignment information from mach-o filesNick Kledzik2014-11-181-1/+1
| | | | llvm-svn: 222201
* [mach-o] Support linker synthesized mach_header symbols.Nick Kledzik2014-11-121-0/+70
| | | | | | | | | | | | | | | | | | | | | | | 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-15/+27
| | | | | | | | | | 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
* [mach-o] refactor KindHandler into ArchHandler and simplify passes.Nick Kledzik2014-07-161-1/+8
| | | | | | | | | | | All architecture specific handling is now done in the appropriate ArchHandler subclass. The StubsPass and GOTPass have been simplified. All architecture specific variations in stubs are now encoded in a table which is vended by the current ArchHandler. llvm-svn: 213187
* MachO: rename _outputFileType to avoid shadowing parent field.Tim Northover2014-06-201-1/+1
| | | | llvm-svn: 211367
* Run llvm/utils/sort_includes.py in a few files.Rafael Espindola2014-06-121-0/+1
| | | | | | This will reduce the noise in a followup patch. llvm-svn: 210800
* Move Simple.h and Alias.h to include/Core.Rui Ueyama2014-06-111-3/+3
| | | | | | | | Because the files in Core actually depend on these files. Differential Revision: http://reviews.llvm.org/D4000 llvm-svn: 210710
* Run clang-format on r197727.Rui Ueyama2013-12-201-3/+2
| | | | llvm-svn: 197788
* [lld] Introduce registry and Reference kind tupleNick Kledzik2013-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main changes are in: include/lld/Core/Reference.h include/lld/ReaderWriter/Reader.h Everything else is details to support the main change. 1) Registration based Readers Previously, lld had a tangled interdependency with all the Readers. It would have been impossible to make a streamlined linker (say for a JIT) which just supported one file format and one architecture (no yaml, no archives, etc). The old model also required a LinkingContext to read an object file, which would have made .o inspection tools awkward. The new model is that there is a global Registry object. You programmatically register the Readers you want with the registry object. Whenever you need to read/parse a file, you ask the registry to do it, and the registry tries each registered reader. For ease of use with the existing lld code base, there is one Registry object inside the LinkingContext object. 2) Changing kind value to be a tuple Beside Readers, the registry also keeps track of the mapping for Reference Kind values to and from strings. Along with that, this patch also fixes an ambiguity with the previous Reference::Kind values. The problem was that we wanted to reuse existing relocation type values as Reference::Kind values. But then how can the YAML write know how to convert a value to a string? The fix is to change the 32-bit Reference::Kind into a tuple with an 8-bit namespace (e.g. ELF, COFFF, etc), an 8-bit architecture (e.g. x86_64, PowerPC, etc), and a 16-bit value. This tuple system allows conversion to and from strings with no ambiguities. llvm-svn: 197727
* Fix include guards.Rui Ueyama2013-11-151-3/+3
| | | | llvm-svn: 194776
* [mach-o] switch to use llvm::MachO:: constantsNick Kledzik2013-09-271-1/+2
| | | | | | Stop using some locally defined mach-o constants. llvm-svn: 191581
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-061-9/+7
| | | | | | | | | Also change some local variable names: "ti" -> "context" and "_targetInfo" -> "_context". Differential Revision: http://llvm-reviews.chandlerc.com/D1301 llvm-svn: 187823
* This is my Driver refactoring patch. Nick Kledzik2013-04-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | 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
* [Core,Driver,ELF] Differentiate static and dynamic executables.Michael J. Spencer2013-02-141-1/+2
| | | | | | | This also adds a simple relocation change for dynamic executables to x86-64 ELF. llvm-svn: 175208
* add elf targethandlerShankar Easwaran2013-01-251-1/+1
| | | | llvm-svn: 173430
* Move SimpleAtoms.h to ReaderWriter.Michael J. Spencer2013-01-241-2/+1
| | | | llvm-svn: 173380
* Move everything over to TargetInfo.Michael J. Spencer2013-01-231-4/+3
| | | | | | | | 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
* Major refactoring: Remove Platform concept. In its place there are Nick Kledzik2012-05-311-0/+50
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