summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Relocations.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Start adding tlsdesc support for aarch64.Rafael Espindola2016-06-021-8/+22
| | | | | | | | | | | | | | | | | This is mostly extracted from http://reviews.llvm.org/D18960. The general idea for tlsdesc is that the two GD got entries are used for a function pointer and its argument. The dynamic linker sets both. In the non-dlopen case the dynamic linker sets the function to the identity and the argument to the offset in the tls block. All that the static linker has to do in the non-dlopen case is relocate the code to point to the got entries and create a dynamic relocation. The dlopen case is more complicated, but can be implemented in another patch. llvm-svn: 271569
* [ELF] - Implemented support for test/binop relaxations from latest ABI.George Rimar2016-06-011-2/+2
| | | | | | | | | | | | | | | Patch implements next relaxation from latest ABI: "Convert memory operand of test and binop into immediate operand, where binop is one of adc, add, and, cmp, or, sbb, sub, xor instructions, when position-independent code is disabled." It is described in System V Application Binary Interface AMD64 Architecture Processor Supplement Draft Version 0.99.8 (https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-r249.pdf, B.2 "B.2 Optimize GOTPCRELX Relocations"). Differential revision: http://reviews.llvm.org/D20793 llvm-svn: 271405
* Revert "bar"Rafael Espindola2016-06-011-3/+3
| | | | | | | This reverts commit r271365. Sorry, wrong branch. llvm-svn: 271366
* barRafael Espindola2016-06-011-3/+3
| | | | llvm-svn: 271365
* [ELF][MIPS] Always resolve MIPS GP-relative relocations to 'local' definitionsSimon Atanasyan2016-05-281-6/+22
| | | | | | | | | | | | | | In case of MIPS, GP-relative relocations always resolve to a definition in a regular input file, ignoring the one-definition rule. Such relocations are used to setup GP relative offsets in a function's prologue. So we, for example, should not attempt to create a dynamic relocation even if the target symbol is preemptible. Fixes bug 27880. Differential Revision: http://reviews.llvm.org/D20664 llvm-svn: 271100
* Removed redundant argument. NFC.George Rimar2016-05-261-1/+1
| | | | llvm-svn: 270847
* [ELF] - Implemented optimization for R_X86_64_GOTPCREL relocation.George Rimar2016-05-251-6/+12
| | | | | | | | | | | | | | | | System V Application Binary Interface AMD64 Architecture Processor Supplement Draft Version 0.99.8 (https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-r249.pdf, B.2 "B.2 Optimize GOTPCRELX Relocations") introduces possible relaxations for R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX. That patch implements the next relaxation: mov foo@GOTPCREL(%rip), %reg => lea foo(%rip), %reg and also opens door for implementing all other ones. Implementation was suggested by Rafael Ávila de Espíndola with few additions and testcases by myself. Differential revision: http://reviews.llvm.org/D15779 llvm-svn: 270705
* Add `static` to a file-scope function.Rui Ueyama2016-05-251-1/+1
| | | | llvm-svn: 270652
* Create Relocations.cpp and move scanRelocs there.Rui Ueyama2016-05-241-0/+637
scanReloc and the functions on which scanReloc depends is in total more than 600 lines of code. Since scanReloc does not depend on Writer, it is better to move it into a separate file. Differential Revision: http://reviews.llvm.org/D20554 llvm-svn: 270606
OpenPOWER on IntegriCloud