summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove the old ELF linker.Rafael Espindola2016-02-281-687/+0
| | | | | | I think it is clear by now that the new linker is viable. llvm-svn: 262158
* [Mips] Remove redundant separate functions to calculate relocations. DoSimon Atanasyan2015-07-251-52/+23
| | | | | | | | that inline. No functional changes. llvm-svn: 243210
* [Mips] Remove duplicated code by joining the same functionsSimon Atanasyan2015-07-251-21/+4
| | | | llvm-svn: 243209
* [Mips] Do not sign-extend addends read from RELA relocation recordsSimon Atanasyan2015-07-251-18/+21
| | | | llvm-svn: 243208
* [Mips] Fix addend writing for R_MIPS_REL32 relocationSimon Atanasyan2015-07-211-7/+15
| | | | llvm-svn: 242760
* [Mips] Handle R_MIPS_JALR relocation to omptimize jalr/jr instructionsSimon Atanasyan2015-07-211-10/+35
| | | | llvm-svn: 242759
* [Mips] Support MIPS big-endian 32/64-bits targetsSimon Atanasyan2015-07-131-16/+49
| | | | llvm-svn: 242014
* [Mips] Support R_MICROMIPS_HI0_LO16 relocation handlingSimon Atanasyan2015-06-221-1/+4
| | | | llvm-svn: 240268
* [Mips] Support R_MICROMIPS_LITERAL relocation handlingSimon Atanasyan2015-06-221-0/+3
| | | | llvm-svn: 240267
* [Mips] Support R_MIPS_LITERAL relocation handlingSimon Atanasyan2015-06-221-1/+3
| | | | llvm-svn: 240266
* [Mips] Support R_MICROMIPS_SUB relocation handlingSimon Atanasyan2015-06-221-2/+6
| | | | llvm-svn: 240265
* [Mips] Support R_MICROMIPS_HIGHER / R_MICROMIPS_HIGHEST relocations handlingSimon Atanasyan2015-06-221-0/+4
| | | | llvm-svn: 240260
* [Mips] Support R_MIPS_HIGHER / R_MIPS_HIGHEST relocations handlingSimon Atanasyan2015-06-221-0/+14
| | | | llvm-svn: 240259
* [Mips] Write inline some more relocation calculationsSimon Atanasyan2015-06-171-112/+20
| | | | | | No functional changes. llvm-svn: 239961
* [Mips] Support R_MICROMIPS_GPREL16 / R_MICROMIPS_GPREL7_S2 relocations handlingSimon Atanasyan2015-06-171-0/+10
| | | | llvm-svn: 239960
* [Mips] Support R_MIPS_16 relocation handlingSimon Atanasyan2015-06-171-0/+3
| | | | llvm-svn: 239959
* [Mips] Do not use functions to calculate trivial relocationsSimon Atanasyan2015-06-171-15/+2
| | | | | | No functional changes. llvm-svn: 239957
* [Mips] Support R_MIPS_PC16 relocation handlingSimon Atanasyan2015-06-131-2/+15
| | | | llvm-svn: 239677
* [Mips] Use standard relocations R_MIPS_HI16/LO16 instead of custom variantsSimon Atanasyan2015-06-131-10/+2
| | | | | | No functional changes. llvm-svn: 239676
* [Mips] Handle TLS relocations in -static linking modeSimon Atanasyan2015-06-121-11/+26
| | | | llvm-svn: 239615
* [Mips] Factor out some bit manipulation code into separate routinesSimon Atanasyan2015-06-061-7/+13
| | | | | | No functional changes. llvm-svn: 239226
* [Mips] Check symbol alignment for some MIPS relocations.Simon Atanasyan2015-06-061-10/+13
| | | | llvm-svn: 239225
* [Mips] Perform an overflow checking for relocations resultsSimon Atanasyan2015-06-061-48/+80
| | | | llvm-svn: 239224
* [Mips] Rearrange relocation related cases in the `switch` operatorSimon Atanasyan2015-06-061-12/+12
| | | | | | No functional changes. llvm-svn: 239223
* [Mips] Use signed/unsigned types in relocation calculations consistentlySimon Atanasyan2015-06-061-52/+41
| | | | | | No functional changes. llvm-svn: 239222
* [Mips] Handle all grouped relocations in a uniform waySimon Atanasyan2015-06-061-36/+56
| | | | | | No functional changes. llvm-svn: 239221
* [Mips] Support R_MICROMIPS_PC18_S3/PC19_S2/PC21_S2/PC26_S2 relocations handlingSimon Atanasyan2015-04-201-4/+16
| | | | llvm-svn: 235289
* [Mips] Support R_MICROMIPS_GOT_DISP / PAGE / OFST relocations handlingSimon Atanasyan2015-04-201-1/+7
| | | | llvm-svn: 235288
* [Mips] Check `_gp_disp` symbol using a trivial string comparisonSimon Atanasyan2015-04-151-3/+1
| | | | | | No functional changes. llvm-svn: 235030
* ELF: Remove redundant namespace qualifiers.Rui Ueyama2015-04-141-3/+3
| | | | llvm-svn: 234938
* ELF: Split HeaderChunks.h to HeaderChunks.{h,cpp}.Rui Ueyama2015-04-141-0/+1
| | | | llvm-svn: 234932
* Define make_dynamic_error_code(const char *).Rui Ueyama2015-04-141-2/+1
| | | | | | | | | | | | The function took either StringRef or Twine. Since string literals are ambiguous when resolving the overloading, many code calls used this function with explicit type conversion. That led awkward code like make_dynamic_error_code(Twine("Error occurred")). This patch adds a function definition for string literals, so that you can directly call the function with literals. llvm-svn: 234841
* ELF: Define ELF{32,64}{LE,BE} types and use them everywhere.Rui Ueyama2015-04-141-6/+6
| | | | llvm-svn: 234823
* [Mips] Move `MipsTargetLayout` class to the separate headerSimon Atanasyan2015-04-131-1/+1
| | | | llvm-svn: 234727
* [Mips] Support R_MICROMIPS_GOT_HI/LO16 and R_MICROMIPS_CALL_HI/LO16 relocationsSimon Atanasyan2015-04-131-1/+11
| | | | llvm-svn: 234726
* [Mips] Support R_MIPS_CALL_HI16 / R_MIPS_CALL_LO16 relocations handlingSimon Atanasyan2015-04-131-2/+6
| | | | llvm-svn: 234725
* [Mips] Support R_MIPS_GOT_HI16 / R_MIPS_GOT_LO16 relocations handlingSimon Atanasyan2015-04-131-0/+18
| | | | llvm-svn: 234724
* [Mips] Support R_MIPS_EH relocation handlingSimon Atanasyan2015-04-101-0/+2
| | | | | | | The patch supports just the R_MIPS_EH relocation handling and does not implement full specification of compact exception tables for MIPS ABIs. llvm-svn: 234634
* [Mips] Replace MipsTargetHandler member function getGP() by getGPAddr()Simon Atanasyan2015-04-101-2/+1
| | | | | | | When we call getGP() we need in fact _gp symbol address. Let's cache its value and return it directly from the new getGPAddr() function. llvm-svn: 234632
* [Mips] Fix typo in the commentSimon Atanasyan2015-04-101-1/+1
| | | | llvm-svn: 234630
* [Mips] Remove redundant non-template MipsRelocationHandler classSimon Atanasyan2015-04-061-2/+2
| | | | llvm-svn: 234155
* [Mips] Replace MipsRelocationHandler::readAddend() by a regular functionSimon Atanasyan2015-04-061-16/+10
| | | | | | | The readAddend() does not depend on MipsRelocationHandler and should not be its member function. llvm-svn: 234154
* ELF: Remove TargetHandler::getTargetLayout.Rui Ueyama2015-03-311-10/+11
| | | | | | | 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-311-4/+2
| | | | | | No functional changes. llvm-svn: 233727
* [Mips] Fix writing R_MIPS_REL32 relocation addendumSimon Atanasyan2015-03-301-0/+8
| | | | | | | | | 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
* [Mips] Support MIPS N64 relocation record formatSimon Atanasyan2015-03-241-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] 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] Add comments to the relocation calculation functionsSimon Atanasyan2015-03-191-1/+6
| | | | | | No functional changes. llvm-svn: 232761
* [Mips] Implement R_MIPS_PCHI16 / R_MIPS_PCLO16 relocations handlingSimon Atanasyan2015-03-191-0/+20
| | | | llvm-svn: 232757
* [Mips] Implement R_MIPS_PC18_S3 relocation handlingSimon Atanasyan2015-03-191-0/+12
| | | | llvm-svn: 232756
OpenPOWER on IntegriCloud