summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/ARM
Commit message (Collapse)AuthorAgeFilesLines
...
* ELF: Define ELF{32,64}{LE,BE} types and use them everywhere.Rui Ueyama2015-04-143-11/+8
| | | | llvm-svn: 234823
* ELF: s/ELFTy/ELFT/ for consistency.Rui Ueyama2015-04-131-4/+4
| | | | llvm-svn: 234790
* [ARM] Use std::call_once for thread safe initializationDenis Protivensky2015-04-131-20/+18
| | | | | | Thanks to r234628 & r234631 llvm-svn: 234733
* [ARM] Replace branch to unreachable with assertionDenis Protivensky2015-04-131-3/+2
| | | | llvm-svn: 234732
* [ARM] Implement PLT for dynamic passDenis Protivensky2015-04-102-0/+109
| | | | | | | | | This includes implementation of PLT0 entry. For testing, libfn.so binary is added since there's no way to link shared objects with lld yet. llvm-svn: 234588
* [ARM] Rework GOT/PLT entry generationDenis Protivensky2015-04-101-21/+23
| | | | | | | Use consistent naming: commonly used generator methods don't have 'Entry' suffices. llvm-svn: 234585
* [ARM] Replace dyn_cast with isa checkDenis Protivensky2015-04-101-1/+1
| | | | llvm-svn: 234582
* [ARM] Improve veneer handling and introduce handlePlain methodDenis Protivensky2015-04-101-1/+13
| | | | | | Handle veneers only for call-like relocations. llvm-svn: 234580
* [ARM] Remove unused variable in dynamic passDenis Protivensky2015-04-101-1/+1
| | | | llvm-svn: 234576
* [ARM] Add skeleton for dynamic relocation passDenis Protivensky2015-04-101-6/+39
| | | | llvm-svn: 234573
* Remove redundant parentheses.Rui Ueyama2015-04-101-3/+3
| | | | llvm-svn: 234558
* [ARM] clang-format ARM sourcesDenis Protivensky2015-04-095-26/+21
| | | | llvm-svn: 234474
* [ARM] Add mapping symbols to veneersDenis Protivensky2015-04-091-38/+127
| | | | | | | | This required splitting up veneer atoms into pieces, where every piece is paired with mapping atom of the corresponding type. llvm-svn: 234473
* 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-071-4/+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
* [ARM] Use getMappingAtomName in Release onlyDenis Protivensky2015-04-071-0/+2
| | | | llvm-svn: 234311
* [ARM] Rename applyThmReloc => applyThumb32RelocDenis Protivensky2015-04-071-6/+6
| | | | llvm-svn: 234302
* [ARM] Add mapping symbols to PLT entriesDenis Protivensky2015-04-071-19/+73
| | | | | | | | | | | | Make PLT entry atoms represent mapping symbols in the Release mode, while in the Debug mode they are still function-like symbols with regular names. It's legal that mapping symbols denote unnamed parts of code, and PLT entries are not required to have function-like names. Differential Revision: http://reviews.llvm.org/D8819 llvm-svn: 234301
* ELF: Do not return error from handleDefinedSymbol.Rui Ueyama2015-04-071-7/+7
| | | | | | | | | | | handleDefinedSymbol has return type of ErrorOr<ELFDefinedAtom *>. However, it never returns an error. We are not checking errors. It's marked as ErrorOr "just in case". That's a bad engineering practice. This patch simplifies the return type of the function. llvm-svn: 234269
* Replace the `createImplicitFiles` method return type with `void`Simon Atanasyan2015-04-061-3/+2
| | | | | | | All instances of the `createImplicitFiles` always return `true` and this return value is used nowhere. llvm-svn: 234205
* ELF: Use short variable names in <Arch>RelocationHandlers.cpp.Rui Ueyama2015-04-041-44/+29
| | | | | | | | 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: 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
* Remove unused functions.Rui Ueyama2015-04-041-6/+0
| | | | llvm-svn: 234069
* ELF: Remove <Arch>ELFReader.h. NFC.Rui Ueyama2015-04-032-32/+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] Delete empty TargetLayout class and rename DefaultLayout to TargetLayoutSimon Atanasyan2015-04-031-1/+1
| | | | | | No functional changes. llvm-svn: 234052
* ELF: Fix header file dependencies.Rui Ueyama2015-04-031-1/+2
| | | | | | | <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
* ELF: Remove partial class definitions of <Arch>LinkingContexts.Rui Ueyama2015-04-031-1/+1
| | | | | | | | | | | | | 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-032-0/+11
| | | | | | | | | | | | | 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-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
* [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: Replace empty classes with typedefs.Rui Ueyama2015-04-021-15/+3
| | | | llvm-svn: 233896
* ELF: Remove a template parameter from ELF{Object,DOS}Reader constructors.Rui Ueyama2015-04-022-2/+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-26/+28
| | | | | | | | | | | | | | | | | | | | | <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: x86, x86-64, ARM, AArch64: Remove architecture name prefixes from class ↵Rui Ueyama2015-04-022-8/+7
| | | | | | members. llvm-svn: 233873
* ELF: Remove <Arch>TargetHandler::kindString.Rui Ueyama2015-04-012-8/+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-7/+4
| | | | llvm-svn: 233863
* Use C++ non-static member initialization.Rui Ueyama2015-04-011-3/+2
| | | | llvm-svn: 233859
* [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: Remove TargetHandlerBase by merging it with TargetHandler.Rui Ueyama2015-04-012-3/+4
| | | | | | | | | | | | | | | | | | | 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: Make findAbsoluteAtom return AtomLayout* instead of an iterator.Rui Ueyama2015-03-312-7/+4
| | | | | | | | | | | 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: 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
* Use DEBUG_TYPE and DEBUG instead of DEBUG_WITH_TYPE.Rui Ueyama2015-03-311-124/+110
| | | | llvm-svn: 233710
OpenPOWER on IntegriCloud