summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/Mips
Commit message (Collapse)AuthorAgeFilesLines
...
* [Mips] Guard modification of register usage masks by mutexSimon Atanasyan2015-04-062-0/+3
| | | | llvm-svn: 234167
* [Mips] Remove redundant non-template MipsRelocationHandler classSimon Atanasyan2015-04-062-7/+3
| | | | llvm-svn: 234155
* [Mips] Replace MipsRelocationHandler::readAddend() by a regular functionSimon Atanasyan2015-04-063-21/+14
| | | | | | | The readAddend() does not depend on MipsRelocationHandler and should not be its member function. llvm-svn: 234154
* [Mips] Reformat the code with clang-formatSimon Atanasyan2015-04-061-1/+2
| | | | llvm-svn: 234153
* [Mips] Rename MipsLinkingContext class methodSimon Atanasyan2015-04-054-4/+4
| | | | | | getMergeReginfoMask => getMergedReginfoMask llvm-svn: 234116
* [Mips] Support writing .MIPS.options section into the linked fileSimon Atanasyan2015-04-053-15/+78
| | | | | | | | In case of MIPS N64 ABI linker should merge registers usage masks stored in the input .MIPS.options sections and save result into the output .MIPS.options section. llvm-svn: 234115
* [Mips] Do not use array initializer to fix Windows build botsSimon Atanasyan2015-04-041-2/+2
| | | | llvm-svn: 234105
* [Mips] Support writing .reginfo section into the linked fileSimon Atanasyan2015-04-047-3/+134
| | | | | | | | | | | In case of MIPS O32 ABI linker should merge registers usage masks stored in the input .reginfo sections and save result into the output .reginfo section. The ABI states that the .reginfo section should be put into the separate segment. This requirement is not implemented in this patch. llvm-svn: 234103
* [Hexagon][Mips] Rename template arguments <arch>ELFType to ELFTSimon Atanasyan2015-04-042-23/+21
| | | | | | In all other ELF related classes we use `ELFT` abbreviation. llvm-svn: 234088
* 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: 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-5/+0
| | | | llvm-svn: 234069
* ELF: Define mergeHeaderFlags to ELFLinkingContext.Rui Ueyama2015-04-044-75/+14
| | | | | | | | | | Only MIPS defined the member function, but this feature is not actually MIPS-specific. Also, the dependency to the MIPS-only member function prevented us from merging <Arch>ELF{Object,DSO}Reader classes. This patch moves the feature from MipsLinkingContext to LinkingContext. llvm-svn: 234068
* [ELF] Merge Layout and TargetLayout classSimon Atanasyan2015-04-031-5/+7
| | | | | | It is enough to have single TargetLayout class. llvm-svn: 234065
* [ELF] Delete empty TargetLayout class and rename DefaultLayout to TargetLayoutSimon Atanasyan2015-04-032-8/+8
| | | | | | No functional changes. llvm-svn: 234052
* ELF: Pass file types instead of type traits to ELFObjectReader.Rui Ueyama2015-04-031-11/+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/+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
* [Mips] Inline the MipsELFWriter::hasGlobalGOTEntry functionSimon Atanasyan2015-04-022-6/+2
| | | | | | No functional changes. llvm-svn: 233924
* ELF: Remove a template parameter from ELF{Object,DOS}Reader constructors.Rui Ueyama2015-04-022-4/+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: 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-025-44/+21
| | | | | | | | | | | | | | | | | | | | | <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 <Arch>TargetHandler::kindString.Rui Ueyama2015-04-012-10/+6
| | | | | | | | | | | | | <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 C++ non-static member initialization.Rui Ueyama2015-04-011-2/+2
| | | | llvm-svn: 233859
* [Mips] Remove 'mips' prefix from class member fields namesSimon Atanasyan2015-04-013-13/+13
| | | | | | No functional changes. llvm-svn: 233812
* ELF: Remove TargetHandlerBase by merging it with TargetHandler.Rui Ueyama2015-04-013-9/+7
| | | | | | | | | | | | | | | | | | | 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-11/+7
| | | | | | | | | | | 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-313-14/+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
* [Mips] Use llvm::make_uniqueSimon Atanasyan2015-03-313-7/+5
| | | | | | No functional changes. llvm-svn: 233727
* [Mips] Remove redundant #includeSimon Atanasyan2015-03-311-2/+0
| | | | | | No functional changes. llvm-svn: 233692
* [Mips] Move the `Elf_RegInfo` structure declaration to the separate fileSimon Atanasyan2015-03-302-36/+51
| | | | | | No functional changes. llvm-svn: 233618
* [Mips] clang-format the codeSimon Atanasyan2015-03-302-6/+2
| | | | | | No functional changes. llvm-svn: 233616
* [Mips] Do not use llvm::Optional for GP0 value and TLS section addressSimon Atanasyan2015-03-301-6/+6
| | | | | | | | | Use of llvm::Optional is redundant here. Initializing by default value 0 is enough. No functional changes. llvm-svn: 233549
* [Mips] Rename class method merge => mergeHeaderFlagsSimon Atanasyan2015-03-303-4/+5
| | | | | | No functional changes. llvm-svn: 233548
* [Mips] Fix writing R_MIPS_REL32 relocation addendumSimon Atanasyan2015-03-303-0/+23
| | | | | | | | | If input relocation records have RELA format while output dynamic relocations have REL format the only way to transfer a dynamic relocation addendum is to save it into the location modified by the dynamic relocation. llvm-svn: 233532
* Rename ELFLinkingContext instances "ctx" intead of "context".Rui Ueyama2015-03-274-21/+20
| | | | llvm-svn: 233344
* Use llvm::make_unique.Rui Ueyama2015-03-261-6/+6
| | | | llvm-svn: 233319
* Remove duplicate code and empty classes.Rui Ueyama2015-03-262-21/+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
* Use alignment values everywhere instead of log2.Rui Ueyama2015-03-261-3/+3
| | | | | | | | This patch defines implicit conversion between integers and PowerOf2 instances, so uses of the classes is now implicit and look like regular integers. Now we are ready to remove the scaffolding. llvm-svn: 233245
* [Mips] Factor out the code that extracts a relocation 'tag' intoSimon Atanasyan2015-03-251-2/+6
| | | | | | | | | the separate function That keeps "extracting" logic into the single place and removes a VC++ compilation warning. llvm-svn: 233186
* [Mips] Suppress "right shift by too large amount" warningSimon Atanasyan2015-03-241-2/+2
| | | | | | | | | | | | | Visual C++ shows the "right shift by too large amount" warning if `MipsELFReference` is instantiated for 32-bit target and `Elf_Rel_Impl::getType` method has `unsigned char` return type. We can freely suppress the warning in that case because MIPS 32-bit ABI does not pack multiple relocation types into the single field `r_type` and the `MipsELFReference::_tag` should be always zero in that case. No functional changes. llvm-svn: 233088
* [Mips] Do not use inheriting constructor due build problem on WindowsSimon Atanasyan2015-03-241-1/+3
| | | | | | No functional changes. llvm-svn: 233058
* [Mips] Support MIPS N64 relocation record formatSimon Atanasyan2015-03-245-20/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | N64 ABI relocation record r_info field in fact consists of five subfields: * r_sym - symbol index * r_ssym - special symbol * r_type3 - third relocation type * r_type2 - second relocation type * r_type - first relocation type Up to three these relocations applied one by one. The first relocation uses an addendum from the relocation record. Each subsequent relocation takes as its addend the result of the previous operation. Only the final operation actually modifies the location relocated. The first relocation uses as a reference symbol specified by the `r_sym` field. The third relocation assumes NULL symbol. The patch represents these data using LLD model and takes in account additional relocation types during a relocation calculation. Additional relocations do not introduce any new relations between two atoms and just specify operations need to be done during a relocation calculation. The first relocation type (`r_type`) stored in the `Reference::_kindValue`. The rest of relocations and `r_ssym` value are stored in the new `Reference::_tag` field "as-is". I decided to do not "decode" these data on the core LLD level to prevent pollution of the core LLD model by very target specific data. Also I have to override writing of relocation records in the `RelocationTable` class to convert MIPS N64 ABI relocation information from the `Reference` class back to the ELF relocation record. http://reviews.llvm.org/D8533 llvm-svn: 233057
* [Mips] Fix typo in the error messageSimon Atanasyan2015-03-241-1/+1
| | | | llvm-svn: 233054
* 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
* [Mips] Pass type of relocation and addendum to the `calculateRelocation`Simon Atanasyan2015-03-221-34/+40
| | | | | | | | | | | separately This change reduce difference between the trunk and upcoming patch and simplify the future code review. No functional changes. llvm-svn: 232919
* [Mips] Rename template argument ELFType => ELFTSimon Atanasyan2015-03-221-21/+17
| | | | | | No functional changes. llvm-svn: 232915
OpenPOWER on IntegriCloud