summaryrefslogtreecommitdiffstats
path: root/lld/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* ELF: Remove <Arch>ELFReader.h. NFC.Rui Ueyama2015-04-0310-162/+46
| | | | | | | | | | | <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] Delete empty TargetLayout class and rename DefaultLayout to TargetLayoutSimon Atanasyan2015-04-039-1037/+1004
| | | | | | No functional changes. llvm-svn: 234052
* ELF: Fix header file dependencies.Rui Ueyama2015-04-036-11/+11
| | | | | | | <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-039-84/+29
| | | | | | | | 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
* Inline typedef'ed type that's used only once. NFC.Rui Ueyama2015-04-031-5/+3
| | | | | | | result_type is no longer part of the type traits, so keeping it here is confusing. llvm-svn: 234044
* [ELF] Fix Layout class name in the commentSimon Atanasyan2015-04-031-2/+2
| | | | | | No functional changes. llvm-svn: 234040
* ELF: Remove partial class definitions of <Arch>LinkingContexts.Rui Ueyama2015-04-038-18/+20
| | | | | | | | | | | | | 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
* Fix for revision r234009 (gcc/msvc compilation differences)Leny Kholodov2015-04-031-1/+1
| | | | llvm-svn: 234014
* [ARM] Implementation of R_ARM_TARGET1 relocationLeny Kholodov2015-04-034-0/+40
| | | | | | | | | | | | | This patch provides implementation of R_ARM_TARGET1 relocation with configuration of its behaviour from a command line. This patch provides two command line options for GnuLd driver: --arm-target1-rel and --arm-target1-abs (similar to ld option names with extra prefix 'arm-'). So user may choose which behaviour of R_ARM_TARGET1 is preferred for his implementation of libc. Differential Revision: http://reviews.llvm.org/D8707 llvm-svn: 234009
* ELF: Remove <Arch>ELFFileCreateELFTraits::result_type.Rui Ueyama2015-04-027-30/+18
| | | | | | | | 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
* [Mips] Inline the MipsELFWriter::hasGlobalGOTEntry functionSimon Atanasyan2015-04-022-6/+2
| | | | | | No functional changes. llvm-svn: 233924
* ELF: Always use variadic templates in CreateELF.h.Rui Ueyama2015-04-021-54/+18
| | | | | | | | Since we no longer support MSVC 2012, we can assume that variadic templates are always supported. This patch removes an #ifdef for C++ compilers that don't support variadic templates. llvm-svn: 233901
* [ARM] Generate PLT entries for calls from ARM and Thumb codeDenis Protivensky2015-04-021-89/+166
| | | | | | | | | | | The function call that goes through PLT table may be performed from both ARM and Thumb code. This situation requires adding a veneer to original PLT code (which is always ARM) to effect Thumb-to-ARM transition. Differential Revision: http://reviews.llvm.org/D8701 llvm-svn: 233900
* [ARM] Report fatal error for wrong ARM entry pointDenis Protivensky2015-04-021-2/+4
| | | | | | | The case is possible with wrong input, so report an error instead of using llvm_unreachable. llvm-svn: 233899
* ELF: Remove {AArch64,X86,X86_64}ELFFile because they are empty.Rui Ueyama2015-04-029-114/+7
| | | | llvm-svn: 233897
* ELF: Replace empty classes with typedefs.Rui Ueyama2015-04-025-74/+15
| | | | llvm-svn: 233896
* ELF: Remove a template parameter from ELF{Object,DOS}Reader constructors.Rui Ueyama2015-04-0213-26/+22
| | | | | | | | | 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: Mips: Remove unused field and almost-empty class.Rui Ueyama2015-04-022-14/+5
| | | | | | | | Looks like MipsTargetHandler::_runtimeFile is unused. MipsRuntimeFile doesn't seem to add values to the base class, so I removed that class too. llvm-svn: 233888
* ELF: Move registerRelocationNames() from TargetHandler to ↵Rui Ueyama2015-04-0226-137/+115
| | | | | | | | | | | | | | | | | | | | | <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: Move x86-64-only function from DefaultLayout to X86_64TargetLayout.Rui Ueyama2015-04-022-48/+31
| | | | | | | | Also removed some over-generalization added in r232866, such as making a function take two parameters and pass two equivalent arguments to the function. llvm-svn: 233882
* ELF: Remove empty classes.Rui Ueyama2015-04-028-27/+16
| | | | llvm-svn: 233880
* ELF: Make createWriterELF's type consistent with other functions.Rui Ueyama2015-04-022-3/+3
| | | | | | | | Other createWriter<Arch> functions take <Arch>LinkingContext as arguments. Only createWriterELF was an exception. This patch makes it consistent with others. llvm-svn: 233878
* ELF: x86, x86-64, ARM, AArch64: Remove architecture name prefixes from class ↵Rui Ueyama2015-04-0217-53/+46
| | | | | | members. llvm-svn: 233873
* Remove unused varaible.Rui Ueyama2015-04-021-2/+0
| | | | llvm-svn: 233872
* ELF: Remove <Arch>TargetHandler::kindString.Rui Ueyama2015-04-0112-53/+36
| | | | | | | | | | | | | <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
* Remove unused variable.Rui Ueyama2015-04-011-1/+0
| | | | llvm-svn: 233864
* Use llvm::make_unique.Rui Ueyama2015-04-018-23/+14
| | | | llvm-svn: 233863
* Use C++ non-static member initialization.Rui Ueyama2015-04-016-34/+24
| | | | llvm-svn: 233859
* [Mips] Remove 'mips' prefix from class member fields namesSimon Atanasyan2015-04-013-13/+13
| | | | | | No functional changes. llvm-svn: 233812
* [ARM] Set specific flags in ELF headerDenis Protivensky2015-04-011-0/+5
| | | | llvm-svn: 233799
* [ARM] Enhance checks for entry pointDenis Protivensky2015-04-011-4/+14
| | | | llvm-svn: 233798
* [ELF][Hexagon] Add comments related to hexagon relocations.Shankar Easwaran2015-04-012-6/+10
| | | | | | No functional changes. llvm-svn: 233783
* [Gnu] Support an other form of defsym optionShankar Easwaran2015-04-011-3/+14
| | | | llvm-svn: 233782
* ELF: Remove TargetHandlerBase by merging it with TargetHandler.Rui Ueyama2015-04-0121-59/+33
| | | | | | | | | | | | | | | | | | | 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-318-53/+7
| | | | | | | | | | | | | | 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: Make findAbsoluteAtom return AtomLayout* instead of an iterator.Rui Ueyama2015-03-3110-63/+55
| | | | | | | | | | | All calls of findAbsoluteAtoms seem a bit awkward because of the type of the function. It semantically returns a pointer to an AtomLayout or nothing, so I made the function return AtomLayout*. In this patch, I also expanded some "auto"s because their actual type were not obvious in their contexts. llvm-svn: 233769
* ELF: Fix dereferencing end() iterator.Rui Ueyama2015-03-311-11/+8
| | | | | | | findAbsoluteAtom() returns absoluteAtom().end() if no atom is found. Dereferencing end() value results an undefined behavior. llvm-svn: 233765
* ELF: Remove TargetHandler::getTargetLayout.Rui Ueyama2015-03-319-37/+15
| | | | | | | 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 "_hexagon" prefix from some member variables.Rui Ueyama2015-03-316-58/+47
| | | | | | | At least in Mips we don't have a prefix for member variables. Repeating the architecture is verbose. llvm-svn: 233746
* Replace *(uniqueptr.get()) with *uniqueptr.Rui Ueyama2015-03-314-8/+8
| | | | | | | Apparently they are copy-pastes. They need to be merged, or otherwise they will diverge needlessly as I did in r233723... llvm-svn: 233741
* Use C++ non-static member initialization.Rui Ueyama2015-03-311-5/+4
| | | | llvm-svn: 233739
* 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-313-37/+37
| | | | | | | Identifiers starting with _[A-Z] is reserved for the language. User programs shouldn't use such identifiers. llvm-svn: 233737
* Remove virtual and add override.Rui Ueyama2015-03-314-22/+22
| | | | llvm-svn: 233735
* [Mips] Use llvm::make_uniqueSimon Atanasyan2015-03-313-7/+5
| | | | | | No functional changes. llvm-svn: 233727
* If x is a unique_ptr, *x.get() is equivalent to *x.Rui Ueyama2015-03-312-3/+3
| | | | llvm-svn: 233723
* Use llvm::make_unique.Rui Ueyama2015-03-311-2/+2
| | | | llvm-svn: 233721
* ELF: Replace a macro with an inlined function.Rui Ueyama2015-03-312-25/+22
| | | | | | | FINDV4BITMASK macro is defined as a macro so that the macro body is inlined. We should use inlined functions instead of macros. llvm-svn: 233719
* ELF: Do not use multiple inheritance.Rui Ueyama2015-03-315-74/+36
| | | | | | | | Multiple inheritance is casually used here. Rewriting to not using multiple inheritance reduces the complexity of the code and also makes it shorter. llvm-svn: 233718
* Use DEBUG_TYPE and DEBUG instead of DEBUG_WITH_TYPE.Rui Ueyama2015-03-312-246/+215
| | | | llvm-svn: 233710
OpenPOWER on IntegriCloud