summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/TargetHandler.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove the old ELF linker.Rafael Espindola2016-02-281-35/+0
| | | | | | I think it is clear by now that the new linker is viable. llvm-svn: 262158
* Define make_dynamic_error_code(const char *).Rui Ueyama2015-04-141-3/+3
| | | | | | | | | | | | The function took either StringRef or Twine. Since string literals are ambiguous when resolving the overloading, many code calls used this function with explicit type conversion. That led awkward code like make_dynamic_error_code(Twine("Error occurred")). This patch adds a function definition for string literals, so that you can directly call the function with literals. llvm-svn: 234841
* [PATCH 08/10] ELF/Aarch64: Add R_AARCH64_ADR_GOT_PAGE and ↵Adhemerval Zanella2015-04-131-0/+4
| | | | | | | | | R_AARCH64_LD64_GOT_LO12_NC checks This patch adds R_AARCH64_ADR_GOT_PAGE overflow and R_AARCH64_LD64_GOT_LO12_NC unaligned value checks. llvm-svn: 234746
* Remove unused includes and forward declarations.Rui Ueyama2015-04-041-24/+2
| | | | llvm-svn: 234070
* [ELF] Merge Layout and TargetLayout classSimon Atanasyan2015-04-031-1/+0
| | | | | | It is enough to have single TargetLayout class. llvm-svn: 234065
* ELF: Remove TargetHandlerBase by merging it with TargetHandler.Rui Ueyama2015-04-011-27/+0
| | | | | | | | | | | | | | | | | | | In r233772, I removed an empty class, DefaultTargetHandler, from the class hierarchy by merging the class with TargetHandler. I then found that TargetHandler and its base class, TargetHandlerBase, are also almost the same. We need to go deeper. In this patch, I merged TargetHandlerBase with TargetHandler. The only difference between them is the existence (or absense) of a pure virtual function registerRelocationName(). I added that function to the (new) TargetHandler. One more thing is that TargetHandler was templated for no reason. I made it non-templated class. llvm-svn: 233773
* ELF: Remove TargetHandler::getTargetLayout.Rui Ueyama2015-03-311-3/+0
| | | | | | | Only MIPS used that member function, and by removing the use of the function, I removed a static_cast. Seems like it's a win. llvm-svn: 233748
* Remove empty constructors.Rui Ueyama2015-03-271-2/+0
| | | | llvm-svn: 233423
* [ELF] Add LinkingContext to the ELFReader.Shankar Easwaran2015-02-121-2/+2
| | | | | | | | | | | | | | | This adds the LinkingContext parameter to the ELFReader. Previously the flags in that were needed in the Context was passed to the ELFReader, this made it very hard to access data structures in the LinkingContext when reading an ELF file. This change makes the ELFReader more flexible so that required parameters can be grabbed directly from the LinkingContext. Future patches make use of the changes. There is no change in functionality though. llvm-svn: 228905
* ELF: Support detection of relocation errors during processingWill Newton2015-01-201-21/+10
| | | | | | | | | | | 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/+0
| | | | | | | These classes contain only abstract virtual functions. Explicit constructors are redundant. llvm-svn: 226265
* [ELF] Remove unused class fieldSimon Atanasyan2015-01-161-5/+1
| | | | | | No functional changes. llvm-svn: 226262
* [ELF] s/_context/_ctx/ and clang-format the codeSimon Atanasyan2015-01-161-9/+6
| | | | | | No functional changes. llvm-svn: 226261
* [ELF] Make the unhandledReferenceType() protected methodSimon Atanasyan2015-01-161-1/+2
| | | | | | No functional changes. llvm-svn: 226260
* [ELF] Make `TargetRelocationHandler` a regular non-template classSimon Atanasyan2015-01-161-2/+2
| | | | | | | This class defines a relocation handler interface. The interface does not depend on the template argument so the argument is redundant. llvm-svn: 226259
* ELF: Add a standard method for unknown relocation errorsWill Newton2014-12-091-0/+27
| | | | | | | | | | | | | | | | | | | 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] Add Readers for all the ELF subtargets.Shankar Easwaran2014-10-181-3/+0
| | | | | | | | | 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
* Don't import error_code into the lld namespace.Rafael Espindola2014-06-121-3/+3
| | | | llvm-svn: 210785
* [ELF] Make changes to all the targets supported currentlyShankar Easwaran2014-01-271-39/+14
| | | | | | | | X86_64,X86,PPC,Hexagon,Mips No change in functionality. llvm-svn: 200177
* [ELF] Create Target specific Writers.Shankar Easwaran2014-01-271-0/+2
| | | | llvm-svn: 200176
* [ELF] Add Target specific Readers.Shankar Easwaran2014-01-271-35/+4
| | | | | | No change in functionality. llvm-svn: 200175
* Linking of shared libraries for MIPS little-endian 32-bit target.Simon Atanasyan2013-12-151-1/+11
| | | | | | | | | | | | | | | | | | | | | The following are the most significant peculiarities of MIPS target: - MIPS ABI requires some special tags in the dynamic table. - GOT consists of two parts local and global. The local part contains entries refer locally visible symbols. The global part contains entries refer global symbols. - Entries in the .dynsym section which have corresponded entries in the GOT should be: * Emitted at the end of .dynsym section * Sorted accordingly to theirs GOT counterparts - There are "paired" relocations. One or more R_MIPS_HI16 and R_MIPS_GOT16 relocations should be followed by R_MIPS_LO16 relocation. To calculate result of R_MIPS_HI16 and R_MIPS_GOT16 relocations we need to combine addends from these relocations and paired R_MIPS_LO16 relocation. The patch reviewed by Michael Spencer, Shankar Easwaran, Rui Ueyama. http://llvm-reviews.chandlerc.com/D2156 llvm-svn: 197342
* 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
* [lld][InputGraph] Change the Resolver to use inputGraphShankar Easwaran2013-10-071-2/+1
| | | | | | | | | | | | 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
* [lld][ELF] Cleanup ELF writing, No change in functionalityShankar Easwaran2013-08-261-3/+3
| | | | | | | | | | The cleanup includes :- * Rename ambiguous Header class to ELFHeader * Convert Chunk contentype and kind to be a enumerated class * Remove functions that are not being used, avoids future confusion llvm-svn: 189209
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-061-4/+4
| | | | | | | | | 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-2/+2
| | | | | | | | | | | | non-ELF writers. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D977 llvm-svn: 184061
* This is my Driver refactoring patch. Nick Kledzik2013-04-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | 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
* Add virtual destructors to fix -Wnon-virtual-dtor warningsAlexey Samsonov2013-03-191-0/+4
| | | | llvm-svn: 177392
* [lld] remove trailing whitespaceShankar Easwaran2013-03-141-6/+6
| | | | llvm-svn: 177079
* add changes for typeDataFastShankar Easwaran2013-02-221-3/+8
| | | | llvm-svn: 175901
* functionality to handle global atoms in Merge sectionsShankar Easwaran2013-02-201-5/+9
| | | | llvm-svn: 175636
* add targethandler hooks from Writer and cleanupShankar Easwaran2013-01-301-54/+0
| | | | llvm-svn: 173904
* [ELF] Add ELFTargetRelocationHandler.Michael J. Spencer2013-01-301-0/+13
| | | | llvm-svn: 173896
* [ELF] Chop the ELF prefix off of most things.Michael J. Spencer2013-01-291-0/+156
llvm-svn: 173838
OpenPOWER on IntegriCloud