summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/AArch64
Commit message (Collapse)AuthorAgeFilesLines
* Remove the old ELF linker.Rafael Espindola2016-02-2815-1764/+0
| | | | | | I think it is clear by now that the new linker is viable. llvm-svn: 262158
* Add File::kind's for all subclasses of File.Pete Cooper2016-01-143-3/+4
| | | | | | | | | | | | This is to enable isa<> support for any files which need it. It will be used in an upcoming patch to differentiate MachOFile from other implicitly generated files. Reviewed by Lang Hames. Differential Revision: http://reviews.llvm.org/D16103 llvm-svn: 257830
* Update for LLVM function name change.Rui Ueyama2016-01-141-1/+1
| | | | llvm-svn: 257801
* Set the folder for libraries to 'lld libraries'. NFC.Pete Cooper2016-01-071-1/+1
| | | | | | | | | | | | In a UI such as XCode, LLVM source files are in 'libraries' while clang files are in 'clang libraries'. This change moves the lld source to 'lld libraries' to make code browsing easier. It should be NFC as the build itself is still the same, just the structure in a UI differs. llvm-svn: 257001
* [ELF/AArch64] Fix export TLS dynamic symbolAdhemerval Zanella2015-07-146-17/+26
| | | | | | | | 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] Set correct loader name in linking contextAdhemerval Zanella2015-07-031-3/+3
| | | | | | | | This patch reimplements ELFLinkingContext::getDefaultInterpreter for aarch64 with correct loader name. It is required to exclude the loader from DT_NEEDED in shared library creation. llvm-svn: 241371
* [ELF/AArch64] Set correct loader name in linking contextAdhemerval Zanella2015-07-031-0/+5
| | | | | | | | This patch reimplements ELFLinkingContext::getDefaultInterpreter for aarch64 with correct loader name. It is required to exclude the loader from DT_NEEDED in shared library creation. llvm-svn: 241370
* [ELF/AArch64] Initial General-dynamic TLS supportAdhemerval Zanella2015-07-013-9/+157
| | | | | | | | | | | | | | This patch adds initial general-dynamic TLS support for AArch64. Currently no optimization is done to realx for more performance-wise models (initial-exec or local-exec). This patch also only currently handles correctly executable generation, although priliminary DSO support through PLT specific creation is also added. With this change clang/llvm bootstrap with lld is possible in static configuration (some DSO creation fails due missing Linker script support, not AArch64 specific), although make check also shows some issues. llvm-svn: 241192
* Simplify Pass::perform to take a SimpleFile& instead of unique_ptr<SimpleFile>&David Blaikie2015-06-191-12/+12
| | | | | | | | None of the implementations replace the SimpleFile with some other file, they just modify the SimpleFile in-place, so a direct reference to the file is sufficient. llvm-svn: 240167
* [lld] Allow LLD passes to return error codes.Lang Hames2015-06-191-1/+3
| | | | llvm-svn: 240147
* [ELF/AArch64] Fix build issue on MSVCAdhemerval Zanella2015-06-032-2/+2
| | | | | | This patch fixes a build issue from r238981. llvm-svn: 238986
* [ELF/AArch64] Fix TLS initial executable relocationAdhemerval Zanella2015-06-039-36/+193
| | | | | | | | | | | | | | | | | | 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-033-9/+23
| | | | | | | | | | | | | | 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-264-7/+35
| | | | | | | | | | | | | 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: Remove redundant namespace qualifiers.Rui Ueyama2015-04-142-2/+2
| | | | llvm-svn: 234938
* ELF: Remove ELFT template argument when referring the base class.Rui Ueyama2015-04-142-4/+4
| | | | | | | | We don't need to repeat the template argument. They are not ambiguous. MIPS is parameterized for ELFT, so we can't do this for MIPS, though. llvm-svn: 234913
* 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-142-3/+3
| | | | | | | | | | | | | | | | | | | 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: Use less templates for ELF types.Rui Ueyama2015-04-143-24/+16
| | | | | | | These classes are templated but actually instantiated for only one ELF type. llvm-svn: 234830
* ELF: Define ELF{32,64}{LE,BE} types and use them everywhere.Rui Ueyama2015-04-143-9/+7
| | | | llvm-svn: 234823
* ELF: s/ELFTy/ELFT/ for consistency.Rui Ueyama2015-04-131-4/+4
| | | | llvm-svn: 234790
* Fix formatting and remove excessive parentheses.Rui Ueyama2015-04-131-7/+9
| | | | llvm-svn: 234781
* ELF/Aarch64: Add overflow checks for relocation writesAdhemerval Zanella2015-04-131-19/+32
| | | | | | | | | This patch adds support for overflow checking when processing R_AARCH64_CALL26, R_AARCH64_JUMP26, R_AARCH64_CONDBR19, R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, and R_AARCH64_TLSLE_ADD_TPREL_HI12 relocations. llvm-svn: 234749
* ELF/AArch64: Add tests for ADR_PREL_LO21Adhemerval Zanella2015-04-131-6/+7
| | | | | | | Add default and overflow checking when processing R_AARCH64_ADR_PREL_LO21 relocations. llvm-svn: 234747
* [PATCH 08/10] ELF/Aarch64: Add R_AARCH64_ADR_GOT_PAGE and ↵Adhemerval Zanella2015-04-131-9/+12
| | | | | | | | | 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
* ELF/Aarch64: Internal variable cleanupAdhemerval Zanella2015-04-131-28/+17
| | | | | | | This patch makes the AArch64GotAtomContent, AArch64Plt0AtomContent, and AArch64PltAtomContent static and also cleanup their formatting. llvm-svn: 234745
* ELF/AArch64: Check ADR_PREL_PG_HI21 for overflowAdhemerval Zanella2015-04-131-5/+8
| | | | | | | | | Add support for overflow checking when processing R_AARCH64_ADR_PREL_PG_HI21 relocations and add test. Patch Will Newton. llvm-svn: 234743
* ELF/AArch64: Add support for R_AARCH64_PREL16Adhemerval Zanella2015-04-131-1/+17
| | | | | | | | Add support for the R_AARCH64_PREL16 relocation type and add tests. Patch by Will Newton. llvm-svn: 234742
* ELF/AArch64: Add support for R_AARCH64_PREL64Adhemerval Zanella2015-04-131-0/+15
| | | | | | | | Add support for the R_AARCH64_PREL64 relocation type and add tests. Patch by Will Newton. llvm-svn: 234741
* ELF/AArch64: Add support for checking PREL32 for overflowAdhemerval Zanella2015-04-131-10/+19
| | | | | | | | | Add support for overflow checking when processing R_AARCH64_PREL32 relocations and add tests. Patch by Will Newton. llvm-svn: 234740
* ELF/AArch64: Add support for R_AARCH64_ABS16Adhemerval Zanella2015-04-131-0/+17
| | | | | | | | Add support for the R_AARCH64_ABS16 relocation type and add tests. Patch by Will Newton. llvm-svn: 234739
* Replace a macro with an inline function.Rui Ueyama2015-04-101-4/+4
| | | | llvm-svn: 234650
* Remove redundant parentheses.Rui Ueyama2015-04-101-4/+4
| | | | llvm-svn: 234558
* [ELF] Remove redundant GOTFile classesSimon Atanasyan2015-04-082-20/+6
| | | | llvm-svn: 234397
* [ELF] Do not save a reference to GOTFile instance in xxxWriter classesSimon Atanasyan2015-04-082-12/+10
| | | | | | | | It's a follow-up to r234347. We do not need to keep a reference to `GOTFile` instance in a xxxWriter class after ownership is transferred to the caller of the `createImplicitFiles` method. llvm-svn: 234396
* [ELF] Remove unused xxxWriter class fieldsSimon Atanasyan2015-04-072-9/+3
| | | | llvm-svn: 234357
* [ELF] Remove redundant override methods which just call base class functionsSimon Atanasyan2015-04-072-8/+0
| | | | llvm-svn: 234356
* Merge MutableFile with SimpleFile.Rui Ueyama2015-04-071-1/+1
| | | | | | | | SimpleFile is the only derived class of MutableFile. This patch reduces the height of class hierarchy by removing MutableFile class. llvm-svn: 234354
* [ELF] Simplify adding default atomsSimon Atanasyan2015-04-072-8/+0
| | | | | | | | | | | | | | | | | | | | | Now 'writer' creates an instance of `RuntimeFile` in the constructor, then populates the file in the virtual function `addDefaultAtoms`, then pass owning of this file to the caller of virtual function `createImplicitFiles`. First, we do not need to keep an instance of `RuntimeFile` so long. It is enough to create the file, right after that populate it and pass the owning. Second, relationship between `createImplicitFiles` and `addDefaultAtoms` is complicated. The `createImplicitFiles` might call `addDefaultAtoms`, overridden version of `addDefaultAtoms` might call base class `addDefaultAtoms`, and overridden version of `createImplicitFiles` might call base class `createImplicitFiles` as well as `addDefaultAtoms`. The patch solves both problems above. It creates and populates runtime files right in the createImplicitFiles(), removes `addDefaultAtoms` at all and does not keep references to runtime files in class fields. llvm-svn: 234347
* Replace the `createImplicitFiles` method return type with `void`Simon Atanasyan2015-04-062-6/+4
| | | | | | | All instances of the `createImplicitFiles` always return `true` and this return value is used nowhere. llvm-svn: 234205
* [ELF] Use override keyword instead of virtualSimon Atanasyan2015-04-061-3/+3
| | | | | | No functional changes. llvm-svn: 234162
* [AArch64] Fix error in AARCH64_ADR_GOT_PAGE handlerDenis Protivensky2015-04-061-1/+1
| | | | | | | | | | The error was introduced during mechanical replacement of raw memory reads/writes to use readxxle/writexxle functions in r230725. Noted and fixed by Suprateeka R Hegde <hegdesmailbox@gmail.com> llvm-svn: 234144
* ELF: Use short variable names in <Arch>RelocationHandlers.cpp.Rui Ueyama2015-04-041-42/+24
| | | | | | | | Functions in the files are hard to read because of line wrapping. Use shorter names for local variables so that the lines fit within 80 columns. llvm-svn: 234087
* ELF: Merge ELFTargets.h with ELFLinkingContext.h.Rui Ueyama2015-04-041-1/+0
| | | | | | | | These functions are "constructors" of the LinkingContexts. We already have auxiliary classes and functions for ELFLinkingContext in the header. They fall in the same category. llvm-svn: 234082
* 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
* Remove unused member function declarations.Rui Ueyama2015-04-041-1/+0
| | | | llvm-svn: 234072
* ELF: Remove <Arch>ELFReader.h. NFC.Rui Ueyama2015-04-032-34/+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: Fix header file dependencies.Rui Ueyama2015-04-031-3/+1
| | | | | | | <Arch>TargetHandler.h and <ArcH>RelocationHandler.h include each other. This patch breaks the circular dependencies. llvm-svn: 234050
* ELF: Pass file types instead of type traits to ELFObjectReader.Rui Ueyama2015-04-031-10/+2
| | | | | | | | All <Arch>ELFFileCreateFileTraits structs are the same except its file type. That means that we don't need to pass the type traits. Instead, we can only pass file types. By doing this, we can remove copy-pasted boilerplates. llvm-svn: 234047
OpenPOWER on IntegriCloud