summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/AArch64/AArch64TargetHandler.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove the old ELF linker.Rafael Espindola2016-02-281-90/+0
| | | | | | I think it is clear by now that the new linker is viable. llvm-svn: 262158
* Update for LLVM function name change.Rui Ueyama2016-01-141-1/+1
| | | | llvm-svn: 257801
* [ELF/AArch64] Fix export TLS dynamic symbolAdhemerval Zanella2015-07-141-2/+4
| | | | | | | | This patch fixes the TLS dynamic variable exportation from .got.plt segments, created by General-dynamic relocations (TLSDESC). Current code only export symbols in dynamic table from .got sections. llvm-svn: 242142
* [ELF/AArch64] Fix build issue on MSVCAdhemerval Zanella2015-06-031-1/+1
| | | | | | This patch fixes a build issue from r238981. llvm-svn: 238986
* [ELF/AArch64] Fix TLS initial executable relocationAdhemerval Zanella2015-06-031-1/+11
| | | | | | | | | | | | | | | | | | This patch fixes the TLS initial executable for AArch64. Current implementation have two issues: 1. does not generate dynamic R_AARCH64_TLS_TPREL64 relocation for the external module symbols, and 2. does not export the TLS initial executable symbol in dynamic symbol table. The fix follows the MIPS strategy to add a arch-specific GOTSection class to keep track of TLS symbols required to be place in dynamic symbol table. It also overrides the buildDynamicSymbolTable for ExecutableWrite class to add the symbols. It also adds some refactoring on AArch64RelocationPass.cpp based on ARM backend. llvm-svn: 238981
* [ELF/AArch64] Fix correct TCB aligment calculationAdhemerval Zanella2015-06-031-4/+20
| | | | | | | | | | | | | | This patch fixes the TLS local relocations alignment done by @238258. As pointed out, the TLS size should not be considered, but rather the TCB size based on maximum output segment alignment. Although it has not shown in the TLS simple cases for test-suite, more comprehensible tests with more local TLS variable showed wrong relocations values being generated. The local TLS testcase is expanded to add more tls variable (both exported and static) initialized or not. llvm-svn: 238960
* [ELF/AArch64] Fix local TLS relocationsAdhemerval Zanella2015-05-261-1/+14
| | | | | | | | | | | | | This patch fixes the R_AARCH64_TLSLE_ADD_TPREL_HI12 and R_AARCH64_TLSLE_ADD_TPREL_LO12_NC handling by using the correct offset by using the target layout along with aarch64 alignments requirements. It fixes the TLS test-suite SingleSource failures for aarch64: * SingleSource/UnitTests/Threads/2010-12-08-tls.execution_time * SingleSource/UnitTests/Threads/tls.execution_time llvm-svn: 238258
* ELF: Inline ELFReader typedefs which are used only once.Rui Ueyama2015-04-141-5/+2
| | | | llvm-svn: 234862
* ELF: Remove ELFT and LinkingContext template parameters from ELFReader.Rui Ueyama2015-04-141-2/+2
| | | | | | | | | | | | | | | | | | | Previously, ELFReader takes three template arguments: EFLT, LinkingContextT and FileT. FileT is itself templated. So it was a bit complicated. Maybe too much. Most architectures don't actually need to be parameterized for ELFT. For example, x86 is always ELF32LE and x86-64 is ELF64LE. However, because ELFReader requires a ELFT argument, we needed to parameterize a class even if not needed. This patch removes the parameter from the class. So now we can de-templatize such classes (I didn't do that in this patch, though). This patch also removes ContextT parameter since it didn't have to be passed as a template argument. llvm-svn: 234853
* ELF: Define ELF{32,64}{LE,BE} types and use them everywhere.Rui Ueyama2015-04-141-4/+3
| | | | llvm-svn: 234823
* ELF: s/ELFTy/ELFT/ for consistency.Rui Ueyama2015-04-131-4/+4
| | | | llvm-svn: 234790
* ELF: Return TargetRelocationHandler instead of <ArcH>TargetRelocationHandler.Rui Ueyama2015-04-041-1/+1
| | | | | | | | | | getRelocationHandler is a public interface to get an instance of TargetRelocationHandler. We don't use any member function other than applyRelocations to a returned instance. Returning a base class instance suffices here. (If a return type is a derived class, it looks like we were using derived classes features.) llvm-svn: 234081
* ELF: Remove ELF{Object,DSO}Reader alias templates.Rui Ueyama2015-04-041-3/+2
| | | | | | | | | | Because of the previous change (r234074), ELFObjectReader became just an alias for ELFReader. We can replace all occurrences of ELFObjectReader with ELFReader. In this patch, I also replaced ELFDSOReader to remove the alias template. llvm-svn: 234076
* ELF: Remove <Arch>ELFReader.h. NFC.Rui Ueyama2015-04-031-4/+9
| | | | | | | | | | | <Arch>ELFReader.h contains only a few typedefs. The typedefs are used only by one class in <Arch>TargetHandler.h. Thus, the headers don't worth to be independent files. Since MipsELFReader.h contains code other than the boilerplate, I didn't touch that file in this patch. llvm-svn: 234056
* ELF: Remove {AArch64,X86,X86_64}ELFFile because they are empty.Rui Ueyama2015-04-021-1/+0
| | | | llvm-svn: 233897
* ELF: Move registerRelocationNames() from TargetHandler to ↵Rui Ueyama2015-04-021-2/+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-6/+1
| | | | llvm-svn: 233880
* ELF: x86, x86-64, ARM, AArch64: Remove architecture name prefixes from class ↵Rui Ueyama2015-04-021-3/+3
| | | | | | members. llvm-svn: 233873
* ELF: Remove <Arch>TargetHandler::kindString.Rui Ueyama2015-04-011-1/+0
| | | | | | | | | | | | | <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
* Use llvm::make_unique.Rui Ueyama2015-04-011-2/+2
| | | | llvm-svn: 233863
* ELF: Remove TargetHandlerBase by merging it with TargetHandler.Rui Ueyama2015-04-011-1/+1
| | | | | | | | | | | | | | | | | | | 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 dead class that does nothing in class hierarchy.Rui Ueyama2015-03-311-2/+1
| | | | | | | | | | | | | | DefaultTargetHandler is the base class of all <Arch>TargetHandler classes, and it's the only derived class of TargetHandler class. TargetHandler and DefaultTargetHandler are actually the same. They define the same set of pure virtual functions. DefaultTargetHandler is a useless class in the class hierarchy -- it shouldn't have been added in the first place. This patch makes all <Arch>TargetHandler classes directly derive from TargetHandler and removes DefaultTargetHandler. llvm-svn: 233772
* ELF: Remove TargetHandler::getTargetLayout.Rui Ueyama2015-03-311-4/+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
* Replace *(uniqueptr.get()) with *uniqueptr.Rui Ueyama2015-03-311-2/+2
| | | | | | | Apparently they are copy-pastes. They need to be merged, or otherwise they will diverge needlessly as I did in r233723... llvm-svn: 233741
* Rename _AArch64TargetLayout.Rui Ueyama2015-03-311-4/+4
| | | | | | | This change should have been done in r233737, but I made a mistake to not include into that. llvm-svn: 233738
* Rename ELFLinkingContext instances "ctx" intead of "context".Rui Ueyama2015-03-271-6/+5
| | | | llvm-svn: 233344
* [ELF] Add LinkingContext to the ELFReader.Shankar Easwaran2015-02-121-4/+4
| | | | | | | | | | | | | | | 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] Check for target architecture.Shankar Easwaran2014-10-201-1/+0
| | | | | | | | | | The canParse function for all the ELF subtargets check if the input files match the subtarget. There were few mismatches in the input files that didnt match the subtarget for which the link was being invoked, which also acts as a test for this change. llvm-svn: 220182
* [ELF] Add Readers for all the ELF subtargets.Shankar Easwaran2014-10-181-3/+11
| | | | | | | | | 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
* Revert "[ELF][AllArchs] Fix includes"Shankar Easwaran2014-10-081-2/+2
| | | | | | This reverts commit e137dd93e1291a2d2fa7f41c8f8bcdb59c8b3225. llvm-svn: 219313
* [ELF][AllArchs] Fix includesShankar Easwaran2014-10-081-2/+2
| | | | llvm-svn: 219278
* [AArch64] Initial ELF/AArch64 SupportChad Rosier2014-08-131-0/+57
This patch adds the initial ELF/AArch64 support to lld. Only a basic "Hello World" app has been successfully tested for both dynamic and static compiling. Differential Revision: http://reviews.llvm.org/D4778 Patch by Daniel Stewart <stewartd@codeaurora.org>! llvm-svn: 215544
OpenPOWER on IntegriCloud