summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove the old ELF linker.Rafael Espindola2016-02-281-36/+0
| | | | | | I think it is clear by now that the new linker is viable. llvm-svn: 262158
* ELF: Define ELF{32,64}{LE,BE} types and use them everywhere.Rui Ueyama2015-04-141-5/+3
| | | | llvm-svn: 234823
* ELF: Move registerRelocationNames() from TargetHandler to ↵Rui Ueyama2015-04-021-12/+0
| | | | | | | | | | | | | | | | | | | | | <Arch>ELFLinkingContext. registerRelocationNames() function is called to register all known ELF relocation types to the central registry. Since we have separate LinkingContext class for each ELF machine type, we need to call the function for each LinkingContext. However, the function belonged to TargetHandler instead of LinkingContext. So we needed to do ctx.getTargetHandler().registerRelocationNames(). This patch removes that redundant getTargetHandler call by moving the function from TargetHandler to LinkingContext. Conceptually this patch is small, but in reality it's not that small. It's because the same code is copied to each architecture. Most of this patch is just repetition. We need to merge them, but that cannot be done in this patch. llvm-svn: 233883
* ELF: Remove empty classes.Rui Ueyama2015-04-021-1/+1
| | | | llvm-svn: 233880
* ELF: x86, x86-64, ARM, AArch64: Remove architecture name prefixes from class ↵Rui Ueyama2015-04-021-5/+5
| | | | | | members. llvm-svn: 233873
* ELF: Remove <Arch>TargetHandler::kindString.Rui Ueyama2015-04-011-4/+2
| | | | | | | | | | | | | <Arch>TargetHandler::kindString is a static member variable containg a list of names of relocation types. The member is used only by one function, registerRelocationNames, so they don't have to be a static member. This patch makes the visibility of the data narrower by making them file-scoped variables in small files. llvm-svn: 233867
* Rename ELFLinkingContext instances "ctx" intead of "context".Rui Ueyama2015-03-271-6/+5
| | | | llvm-svn: 233344
* Use llvm::make_unique.Rui Ueyama2015-03-261-4/+4
| | | | llvm-svn: 233319
* ELF: Support detection of relocation errors during processingWill Newton2015-01-201-1/+1
| | | | | | | | | | | At the moment errors in relocation processing such as out of range values are not detected or at best trapped by asserts which will not be present in release builds. This patch adds support for checking error return values from applyRelocation() calls and printing an appropriate error message. It also adds support for printing multiple errors rather than just the first one. llvm-svn: 226557
* [ELF] Remove TargetHandler and DefaultTargetHandler constructorsSimon Atanasyan2015-01-161-3/+2
| | | | | | | These classes contain only abstract virtual functions. Explicit constructors are redundant. llvm-svn: 226265
* ELF: Add a standard method for unknown relocation errorsWill Newton2014-12-091-1/+1
| | | | | | | | | | | | | | | | | | | At present each TargetRelocationHandler generates a pretty similar error string and calls llvm_unreachable() when encountering an unknown relocation. This is not ideal for two reasons: 1. llvm_unreachable disappears in release builds but we still want to know if we encountered a relocation we couldn't handle in release builds. 2. Duplication is bad - there is no need to have a per-architecture error message. This change adds a test for AArch64 to test whether or not the error message actually works. The other architectures have not been tested but they compile and check-lld passes. llvm-svn: 223782
* ELF: Use ELF reloc .def files to reduce duplicationWill Newton2014-12-051-41/+5
| | | | | | Tested with check-lld with no regressions. llvm-svn: 223462
* [ELF] Add Readers for all the ELF subtargets.Shankar Easwaran2014-10-181-49/+6
| | | | | | | | | This would permit the ELF reader to check the architecture that is being selected by the linking process. This patch also sorts the include files according to LLVM conventions. llvm-svn: 220129
* More prefixing of error_code.Rafael Espindola2014-06-121-3/+3
| | | | llvm-svn: 210831
* Use error_code() instead of error_code::succes()Rafael Espindola2014-05-311-2/+2
| | | | | | | There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code. llvm-svn: 209948
* [ELF] Make changes to all the targets supported currentlyShankar Easwaran2014-01-271-3/+20
| | | | | | | | X86_64,X86,PPC,Hexagon,Mips No change in functionality. llvm-svn: 200177
* Run clang-format on r197727.Rui Ueyama2013-12-201-4/+1
| | | | llvm-svn: 197788
* [lld] Introduce registry and Reference kind tupleNick Kledzik2013-12-191-8/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make anonymous namespace as small as possible.Rui Ueyama2013-12-101-4/+2
| | | | | | Use of static is recommended by the style guide. llvm-svn: 196877
* Replace ErrorOr<void> with error_code.Rafael Espindola2013-11-051-1/+1
| | | | | | It was never transporting any value in addition to the error_code. llvm-svn: 194028
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-061-7/+6
| | | | | | | | | Also change some local variable names: "ti" -> "context" and "_targetInfo" -> "_context". Differential Revision: http://llvm-reviews.chandlerc.com/D1301 llvm-svn: 187823
* [lld] Move AtomLayout from ELF to ReaderWriter so that it can be used by ↵Rui Ueyama2013-06-161-1/+1
| | | | | | | | | | | | non-ELF writers. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D977 llvm-svn: 184061
* add changes for layoutafter/layoutbefore/ingroup/layoutpass and test casesShankar Easwaran2013-02-071-1/+5
| | | | llvm-svn: 174658
* [ELF] Use the target's LayoutHandler.Michael J. Spencer2013-01-301-1/+2
| | | | llvm-svn: 173966
* [ELF] Remove ReferenceKinds.Michael J. Spencer2013-01-301-2/+2
| | | | llvm-svn: 173912
* [ELF] Add {Hexagon,PPC,X86}TargetHandler.Michael J. Spencer2013-01-301-0/+67
llvm-svn: 173909
OpenPOWER on IntegriCloud