summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [Mips] Implement R_MIPS_PC19_S2 / R_MIPS_PC26_S2 relocations handlingSimon Atanasyan2015-03-191-0/+24
| | | | llvm-svn: 232755
* [Mips] Implement R_MIPS_PC21_S2 relocation handlingSimon Atanasyan2015-03-191-0/+12
| | | | llvm-svn: 232707
* [Mips] Replace "hand-made" function by the `llvm::SignExtend32()` routineSimon Atanasyan2015-03-191-12/+7
| | | | | | No functional changes. llvm-svn: 232705
* [Mips] Implement R_MIPS_TLS_xxx relocation handling in case of N64 ABISimon Atanasyan2015-03-161-0/+7
| | | | llvm-svn: 232361
* [Mips] Implement R_MIPS_GOT_DISP/PAGE/OFST relocations handlingSimon Atanasyan2015-03-161-7/+25
| | | | llvm-svn: 232360
* [Mips] Group some cases in the switch statementSimon Atanasyan2015-03-161-9/+6
| | | | | | No functional changes. llvm-svn: 232359
* [Mips] Make `readAddend` a virtual member function to escape explicitSimon Atanasyan2015-03-121-10/+21
| | | | | | | | template class instantiation No functional changes. llvm-svn: 232081
* [Mips] Remove unused includeSimon Atanasyan2015-03-091-1/+0
| | | | | | No functional changes. llvm-svn: 231646
* [Mips] Remove redundant namespace qualifiersSimon Atanasyan2015-03-091-35/+35
| | | | | | No functional changes. llvm-svn: 231645
* [Mips] Rename local variablesSimon Atanasyan2015-03-091-6/+5
| | | | | | No functional changes. llvm-svn: 231644
* [Mips] Implement R_MIPS_SUB relocation handlingSimon Atanasyan2015-03-091-0/+7
| | | | llvm-svn: 231643
* [Mips] Implement R_MIPS_64 relocation handlingSimon Atanasyan2015-03-091-31/+67
| | | | llvm-svn: 231642
* [Mips] Refactoring of relocation handling functionsSimon Atanasyan2015-03-091-176/+202
| | | | | | | | | | | 1. Move relocation addendum reading code to the MipsRelocationHandler class to reduce code duplication. 2. Factor out the relocations calculation code into the separate function to be ready to handle MIPS N64 ABI relocation chains. No functional changes. llvm-svn: 231641
* [Mips] Show error message and stop linking in case of cross mode jump errorsSimon Atanasyan2015-03-091-12/+16
| | | | llvm-svn: 231640
* [Mips] Fix incorrect handling of cross mode jumpsSimon Atanasyan2015-03-091-24/+38
| | | | | | | | We should not take in account a type of "source" symbol. Cross mode jump adjustment is requred when target symbol and relocation belong to different (regular/microMIPS) instruction sets. llvm-svn: 231639
* [Mips] Remove unused function argumentSimon Atanasyan2015-01-271-4/+4
| | | | | | No functional changes. llvm-svn: 227245
* [Mips] Support R_MIPS_GPREL16 relocationSimon Atanasyan2015-01-271-0/+12
| | | | llvm-svn: 227244
* [Mips] Fix createMipsRelocationHandler specialization (take 2)Denis Protivensky2015-01-271-2/+8
| | | | | | | | | | | Misread buildbot's log. Both gcc and clang compile this fine. Original fix reason: gcc allows template specializations only in the same namespace where template has been declared. llvm-svn: 227183
* Revert "[Mips] Fix createMipsRelocationHandler specialization"Denis Protivensky2015-01-271-8/+2
| | | | | | The buildbot reported build failures for clang. llvm-svn: 227179
* [Mips] Fix createMipsRelocationHandler specializationDenis Protivensky2015-01-271-2/+8
| | | | | | | gcc allows template specializations only in the same namespace where template has been declared. llvm-svn: 227177
* [Mips] Teach LLD to recognize one more MIPS target triple - mips64elSimon Atanasyan2015-01-251-3/+40
| | | | | | | | | | | | This is initial patch to support MIPS64 object files linking. The patch just makes some classes more generalized, and rejects attempts to interlinking O32 and N64 ABI object files. I try to reuse the current MIPS target related classes as much as possible because O32 and N64 MIPS ABI are tightly related and share almost the same set of relocations, GOT, flags etc. llvm-svn: 227058
* [Mips] Reformat the code with clang-formatSimon Atanasyan2015-01-251-2/+1
| | | | | | No functional changes. llvm-svn: 227049
* ELF: Support detection of relocation errors during processingWill Newton2015-01-201-1/+1
| | | | | | | | | | | 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
* [Mips] Replace stderr output by the `llvm_unreachable` callSimon Atanasyan2014-12-251-4/+4
| | | | | | | | | If a regular symbol has microMIPS-bit we need to stop linking. Now the LLD does not check the `applyRelocation` return value and continues linking anyway. As a temporary workaround use the `llvm_unreachable` call to stop the linker. llvm-svn: 224831
* [Mips] Support linking of microMIPS 32-bit codeSimon Atanasyan2014-12-241-16/+180
| | | | | | | The change is rather large but mainly it just adds handling of new relocations, PLT entries etc. llvm-svn: 224826
* ELF: Add a standard method for unknown relocation errorsWill Newton2014-12-091-6/+2
| | | | | | | | | | | | | | | | | | | 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
* [Mips] Simplify the code calculates HI16/LO16 relocationsSimon Atanasyan2014-11-201-15/+3
| | | | | | No functional changes. llvm-svn: 222470
* [Mips] Remove duplicated relocation calculation routinesSimon Atanasyan2014-11-201-20/+8
| | | | | | No functional changes. llvm-svn: 222469
* [Mips] Remove unused function argumentSimon Atanasyan2014-11-201-2/+2
| | | | | | No functional changes. llvm-svn: 222468
* [Mips] Use endian::read/write function to load/save MIPS32 instructionsSimon Atanasyan2014-11-201-39/+41
| | | | | | No functional changes. llvm-svn: 222467
* [Mips] Do not read addends for relocations which do not use themSimon Atanasyan2014-11-101-8/+3
| | | | | | No functional changes. llvm-svn: 221602
* Fix unicode chars into ascii in comment lines.NAKAMURA Takumi2014-10-271-1/+1
| | | | llvm-svn: 220668
* [ELF] Add Readers for all the ELF subtargets.Shankar Easwaran2014-10-181-1/+0
| | | | | | | | | This would permit the ELF reader to check the architecture that is being selected by the linking process. This patch also sorts the include files according to LLVM conventions. llvm-svn: 220129
* More prefixing of error_code.Rafael Espindola2014-06-121-3/+3
| | | | llvm-svn: 210831
* [Mips] Handle Mips TLS relocations R_MIPS_TLS_GOTTPREL / R_MIPS_TLS_GD / ↵Simon Atanasyan2014-06-071-2/+14
| | | | | | R_MIPS_TLS_LDM etc. llvm-svn: 210394
* Use error_code() instead of error_code::succes()Rafael Espindola2014-05-311-2/+2
| | | | | | | There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code. llvm-svn: 209948
* [Mips] Do not mix _gp and _gp_disp symbols in relocation handling.Simon Atanasyan2014-05-281-4/+5
| | | | | | No functional changes. llvm-svn: 209709
* [Mips] Reduce code duplication. Join relocation handling functions whichSimon Atanasyan2014-05-251-15/+6
| | | | | | perform calculations for R_MIPS_GOT16 and R_MIPS_CALL16 relocations. llvm-svn: 209594
* [Mips] Reduce code duplication. Join relocation handling functions whichSimon Atanasyan2014-05-251-18/+8
| | | | | | perform similar calculations. llvm-svn: 209590
* [Mips] Handle R_MIPS_TLS_TPREL_HI16 / R_MIPS_TLS_TPREL_LO16 relocations.Simon Atanasyan2014-05-241-0/+20
| | | | llvm-svn: 209582
* [Mips] Simplify handling of R_MIPS_LO16 / R_MIPS_HI16 relocationsSimon Atanasyan2014-05-211-8/+8
| | | | | | against _gp_disp symbol. llvm-svn: 209315
* [Mips] Fix calculation of initial GOT entry value when this entry isSimon Atanasyan2014-05-171-1/+1
| | | | | | referenced by a local symbol. llvm-svn: 209063
* [Mips] R_MIPS_GPREL32 relocation support.Simon Atanasyan2014-05-051-0/+11
| | | | llvm-svn: 207949
* [Mips] Implement emitting of R_MIPS_REL32 relocations:Simon Atanasyan2014-04-291-0/+5
| | | | | | | | | | | | | 1. Re-implement PLT entries and dynamic relocations emitting to keep PLT and relocations table in a consistent state. 2. Initialize st_value and st_other fields for dynamic symbols table entry if this entry corresponds to an external function which address is taken in a non-PIC executable. In that case the st_value field holds an address of the function's PLT entry. Also set STO_MIPS_PLT bit in the st_other field. llvm-svn: 207494
* [Mips] R_MIPS_PC32 relocation support.Simon Atanasyan2014-04-111-0/+9
| | | | llvm-svn: 206018
* Make anonymous namespace as small as possible.Rui Ueyama2014-03-271-20/+15
| | | | llvm-svn: 204982
* [Mips] Remove unused function.Simon Atanasyan2014-03-191-7/+0
| | | | llvm-svn: 204248
* [Mips] Fix handling of R_MIPS_GOT16 relocation and building local partSimon Atanasyan2014-03-191-0/+8
| | | | | | | | | of GOT. * Read addend for R_MIPS_GOT16 relocation. * Put only high 16 bits of symbol + addend into GOT entries for locally visible symbols. llvm-svn: 204247
* [Mips] Handle R_MIPS_GOT16 relocation for external and local symbols inSimon Atanasyan2014-03-191-3/+0
| | | | | | a uniform way. llvm-svn: 204246
* [Mips] Move AHL addends calculation to the RelocationPass class.Simon Atanasyan2014-03-191-53/+5
| | | | llvm-svn: 204243
OpenPOWER on IntegriCloud