summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/ReferenceKinds.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [mach-o] refactor KindHandler into ArchHandler and simplify passes.Nick Kledzik2014-07-161-1100/+0
| | | | | | | | | | | 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
* [mach-o] Add parsing of arm/thumb relocationsNick Kledzik2014-07-041-58/+452
| | | | | | | | | | This converts the very complicated mach-o arm relocations into the simple Reference Kinds in lld. The next patch will use the internal Reference kinds to fix up arm/thumb code. llvm-svn: 212306
* [mach-o] add x86 test case to build hello world. Fix bugs it uncovered.Nick Kledzik2014-07-031-10/+21
| | | | llvm-svn: 212247
* [mach-o] add parsing of x86 relocationsNick Kledzik2014-07-021-22/+169
| | | | llvm-svn: 212239
* [mach-o] x86_64 relocation code review fixesNick Kledzik2014-06-301-2/+3
| | | | llvm-svn: 212068
* [mach-o] refactor x86_64 relocation handling.Nick Kledzik2014-06-271-52/+303
| | | | | | | | | | | | | | This is first step in reworking how mach-o relocations are processed. The existing KindHandler is going to become a delgate/helper object for processing architecture specific references. The KindHandler knows how to convert mach-o relocations into References and back, as well, as fixing up the content the relocation is on. One of the messy things about mach-o relocations is that they sometime come in pairs, but the pairs still convert to one lld::Reference. So, the conversion has to detect pairs (arch specific) and change the stride. llvm-svn: 211921
* Run clang-format on r197727.Rui Ueyama2013-12-201-92/+84
| | | | llvm-svn: 197788
* [lld] Introduce registry and Reference kind tupleNick Kledzik2013-12-191-233/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-061-10/+10
| | | | | | | | | 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-7/+11
| | | | | | | | | | | | | | | | | | | | | | | 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-30/+30
| | | | llvm-svn: 177079
* Move everything over to TargetInfo.Michael J. Spencer2013-01-231-8/+7
| | | | | | | | 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
* Fix -Wcovered-switch-default warning.Michael J. Spencer2012-09-281-2/+0
| | | | llvm-svn: 164846
* Add 'invalid' as a Reference Kind so that unknown/invalid kind strings can ↵Nick Kledzik2012-06-151-3/+21
| | | | | | return that fact to the caller for use in constructing an error message, rather that triggering an assertion. llvm-svn: 158547
* remove return statements after llvm_unreachable() as the compiler no longer ↵Nick Kledzik2012-06-151-6/+0
| | | | | | warns abot missing return values llvm-svn: 158544
* use llvm_unreachable() instead of assert(0) for invalid enum values in ↵Nick Kledzik2012-06-151-6/+7
| | | | | | switch statements llvm-svn: 158542
* Use ADT/StringSwitchNick Kledzik2012-06-151-73/+41
| | | | llvm-svn: 158541
* flesh out mach-o Reference KindsNick Kledzik2012-06-121-71/+177
| | | | llvm-svn: 158375
* Move implementation of WriterOptionsMachO to its own file. Reduced redundantNick Kledzik2012-06-111-60/+274
| | | | | | | | 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
* Major refactoring: Remove Platform concept. In its place there are Nick Kledzik2012-05-311-0/+103
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