summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/AArch64
Commit message (Collapse)AuthorAgeFilesLines
...
* ELF: Remove partial class definitions of <Arch>LinkingContexts.Rui Ueyama2015-04-031-1/+2
| | | | | | | | | | | | | What we are doing in ELFTarget.h was dubious. In the file, we define partial classes of <Arch>LinkingContexts to declare only static member functions. We have different (complete) class definitions in other files. They would conflict if they exist in the same compilation unit (because the ones defined in ELFTarget.h has only static member functions). I don't think this was valid C++. http://reviews.llvm.org/D8797 llvm-svn: 234039
* ELF: Remove <Arch>ELFFileCreateELFTraits::result_type.Rui Ueyama2015-04-021-4/+2
| | | | | | | | result_type is always ErrorOr<unique_ptr<File>>, and since the type traits is for instantiating ELF files, it's unlikely that we want to return something else. This patch removes that type. llvm-svn: 233948
* ELF: Remove {AArch64,X86,X86_64}ELFFile because they are empty.Rui Ueyama2015-04-023-38/+3
| | | | llvm-svn: 233897
* ELF: Replace empty classes with typedefs.Rui Ueyama2015-04-021-14/+3
| | | | llvm-svn: 233896
* ELF: Remove a template parameter from ELF{Object,DOS}Reader constructors.Rui Ueyama2015-04-022-3/+3
| | | | | | | | | There is one-to-one correspondence between ELF machine type and a LinkingContext. We passed them as separate arguments to the constructor. This patch is to teach the LinkingContexts about their machine types, so that we don't need to pass that data as separate arguments. llvm-svn: 233894
* ELF: Move registerRelocationNames() from TargetHandler to ↵Rui Ueyama2015-04-024-18/+18
| | | | | | | | | | | | | | | | | | | | | <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-024-13/+8
| | | | llvm-svn: 233880
* ELF: x86, x86-64, ARM, AArch64: Remove architecture name prefixes from class ↵Rui Ueyama2015-04-024-12/+11
| | | | | | members. llvm-svn: 233873
* Remove unused varaible.Rui Ueyama2015-04-021-2/+0
| | | | llvm-svn: 233872
* ELF: Remove <Arch>TargetHandler::kindString.Rui Ueyama2015-04-012-10/+7
| | | | | | | | | | | | | <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-012-4/+3
| | | | llvm-svn: 233863
* Use C++ non-static member initialization.Rui Ueyama2015-04-011-7/+5
| | | | llvm-svn: 233859
* ELF: Remove TargetHandlerBase by merging it with TargetHandler.Rui Ueyama2015-04-012-3/+3
| | | | | | | | | | | | | | | | | | | 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-312-2/+2
| | | | | | | | | | | | | | 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-314-12/+12
| | | | | | | This change should have been done in r233737, but I made a mistake to not include into that. llvm-svn: 233738
* Rename identifiers starting with an underscore and a uppercase letter.Rui Ueyama2015-03-311-14/+14
| | | | | | | Identifiers starting with _[A-Z] is reserved for the language. User programs shouldn't use such identifiers. llvm-svn: 233737
* Use DEBUG_TYPE and DEBUG instead of DEBUG_WITH_TYPE.Rui Ueyama2015-03-311-122/+105
| | | | llvm-svn: 233710
* Rename all caps class names.Rui Ueyama2015-03-272-4/+4
| | | | | | | We have GOTAtom and PLTAtom classes because GOT or PLT are acronyms. "Dynamic offset table" or "dynamic" are not acronyms. llvm-svn: 233401
* Rename ELFLinkingContext instances "ctx" intead of "context".Rui Ueyama2015-03-274-24/+22
| | | | llvm-svn: 233344
* Use llvm::make_unique.Rui Ueyama2015-03-261-5/+4
| | | | llvm-svn: 233319
* Remove duplicate code and empty classes.Rui Ueyama2015-03-262-19/+2
| | | | llvm-svn: 233316
* Remove Makefiles.Rui Ueyama2015-03-261-15/+0
| | | | | | | | Most developers prefer to not have them, and we agreed to remove them from LLD. http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/083368.html llvm-svn: 233313
* Fix the CMake shared build.Benjamin Kramer2015-03-231-1/+2
| | | | | | | The ELF backends now depend on lld::script::Sema, which is in libReaderWriter. Link it explicitly. llvm-svn: 232953
* [ELF] Rename .got.dyn to .gotShankar Easwaran2015-03-141-1/+1
| | | | | | Gnu doesnot creates only a .got section. llvm-svn: 232252
* Remove duplicate code. NFC.Rui Ueyama2015-03-071-5/+1
| | | | llvm-svn: 231570
* Remove include/lld/Core/Endian.h and use llvm/Support/Endian.h instead.Rui Ueyama2015-03-021-2/+3
| | | | llvm-svn: 231005
* Add missing includes for make_unique, lld edition.Benjamin Kramer2015-03-021-0/+1
| | | | llvm-svn: 230925
* Add {read,write}{16,32,64}{le,be} functions.Rui Ueyama2015-02-271-60/+21
| | | | | | | | | | | | | | Nothing wrong with reinterpret_cast<llvm::support::ulittle32_t *>(loc), but that's redundant and not great from readability point of view. The new functions are wrappers for that kind of reinterpet_casts. Surprisingly or unsurprisingly, there was no use of big endian read and write. {read,write}{16,32,64}be have no user. But I think they still worth to be there in the header for completeness. http://reviews.llvm.org/D7927 llvm-svn: 230725
* ELF/AArch64: Add support for checking for ABS32 overflowWill Newton2015-02-131-5/+14
| | | | | | | Add support for checking overflow when applying a R_AARCH64_ABS32 relocation and add a test to ensure it behaves correctly. llvm-svn: 229072
* Remove unused parameters.Rui Ueyama2015-02-131-4/+2
| | | | llvm-svn: 229055
* [ELF] Add LinkingContext to the ELFReader.Shankar Easwaran2015-02-123-22/+22
| | | | | | | | | | | | | | | 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
* Use make_unique.Rui Ueyama2015-02-061-5/+4
| | | | llvm-svn: 228453
* Fix the ELF shared library build targets - take 2Greg Fitzgerald2015-01-245-14/+18
| | | | | | | | | | lldELF is used by each ELF backend. lldELF's ELFLinkingContext also held a reference to each backend, creating a link-time cycle. This patch moves the backend references to lldDriver. Differential Revision: http://reviews.llvm.org/D7119 llvm-svn: 226976
* Revert " Fix the ELF shared library build targets"Greg Fitzgerald2015-01-235-9/+14
| | | | | | This reverts commit 6a3f545b44cea46321e025d9ab773786af86cb51. llvm-svn: 226928
* Fix the ELF shared library build targetsGreg Fitzgerald2015-01-235-14/+9
| | | | | | | | | | lldELF is used by each ELF backend. lldELF's ELFLinkingContext also held a reference to each backend, creating a link-time cycle. This patch moves the backend references to lldDriver. Differential Revision: http://reviews.llvm.org/D7119 llvm-svn: 226922
* add_lld_library -> add_llvm_libraryGreg Fitzgerald2015-01-211-7/+4
| | | | | | | | | | | * Works better for shared libraries (sets PRIVATE instead of INTERFACE) * Fixes http://llvm.org/bugs/show_bug.cgi?id=22269 * Also, use build-target names instead of component names Differential Revision: http://reviews.llvm.org/D7074 From: Greg Fitzgerald <garious@gmail.com> llvm-svn: 226702
* ELF: Support detection of relocation errors during processingWill Newton2015-01-203-5/+2
| | | | | | | | | | | 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
* Add LLVM_LINK_COMPONENTS for the shared object buildGreg Fitzgerald2015-01-161-0/+2
| | | | | | | Differential Revision: http://reviews.llvm.org/D7023 From: Greg Fitzgerald <garious@gmail.com> llvm-svn: 226346
* [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] Make `TargetRelocationHandler` a regular non-template classSimon Atanasyan2015-01-161-3/+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
* Separate file parsing from File's constructors.Rui Ueyama2014-12-121-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a second patch for InputGraph cleanup. Sorry about the size of the patch, but what I did in this patch is basically moving code from constructor to a new method, parse(), so the amount of new code is small. This has no change in functionality. We've discussed the issue that we have too many classes to represent a concept of "file". We have File subclasses that represent files read from disk. In addition to that, we have bunch of InputElement subclasses (that are part of InputGraph) that represent command line arguments for input file names. InputElement is a wrapper for File. InputElement has parseFile method. The method instantiates a File. The File's constructor reads a file from disk and parses that. Because parseFile method is called from multiple worker threads, file parsing is processed in parallel. In other words, one reason why we needed the wrapper classes is because a File would start reading a file as soon as it is instantiated. So, the reason why we have too many classes here is at least partly because of the design flaw of File class. Just like threads in a good threading library, we need to separate instantiation from "start" method, so that we can instantiate File objects when we need them (which should be very fast because it involves only one mmap() and no real file IO) and use them directly instead of the wrapper classes. Later, we call parse() on each file in parallel to let them do actual file IO. In this design, we can eliminate a reason to have the wrapper classes. In order to minimize the size of the patch, I didn't go so far as to replace the wrapper classes with File classes. The wrapper classes are still there. In this patch, we call parse() immediately after instantiating a File, so this really has no change in functionality. Eventually the call of parse() should be moved to Driver::link(). That'll be done in another patch. llvm-svn: 224102
* [ELF] Remove duplicate constructor code.Rui Ueyama2014-12-111-33/+4
| | | | | | This piece of code was copied multiple times to each archs. llvm-svn: 224001
* [ELF] Make -init/-fini options compatible with the gnu linkerSimon Atanasyan2014-12-102-92/+0
| | | | | | | | | | | | | | The LLD linker searches initializer and finalizer function names and emits DT_INIT/DT_FINI dynamic table tags to point to these symbols. The -init/-fini command line options override initializer ("_init") and finalizer ("_fini") function names used by default. Now the -init/-fini options do not affect .init_array/.fini_array sections. The corresponding code has been removed. Differential Revision: http://reviews.llvm.org/D6578 llvm-svn: 223917
* Fix the MSVC buildHans Wennborg2014-12-091-1/+2
| | | | llvm-svn: 223796
* ELF: Add a standard method for unknown relocation errorsWill Newton2014-12-094-13/+4
| | | | | | | | | | | | | | | | | | | 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-83/+7
| | | | | | Tested with check-lld with no regressions. llvm-svn: 223462
* Rename R_AARCH64_TLSDESC_ADR_PAGE to R_AARCH64_TLSDESC_ADR_PAGE21Will Newton2014-11-261-1/+1
| | | | llvm-svn: 222823
* Fix comment in AArch64 ELF backendWill Newton2014-11-261-1/+1
| | | | llvm-svn: 222814
OpenPOWER on IntegriCloud