llvm-project/lld/ELF
Simon Atanasyan 57830b60dc [ELF][MIPS] Implement R_MIPS_GPREL16/R_MIPS_GPREL32 relocations
The R_MIPS_GPREL16 / R_MIPS_GPREL32 relocations use the following
expressions for calculations:
```
local symbol:  S + A + GP0 - GP
global symbol: S + A - GP

GP  - Represents the final gp value, i.e. _gp symbol
GP0 - Represents the gp value used to create the relocatable object
```
The GP0 value is taken from the .reginfo data section defined by an object
file. To implement that I keep a reference to `MipsReginfoInputSection`
in the `ObjectFile` class. This reference is used by the
`ObjectFile::getMipsGp0` method to return the GP0 value.

Differential Revision: http://reviews.llvm.org/D15760

llvm-svn: 256416
2015-12-25 13:02:13 +00:00
..
CMakeLists.txt ELF2: Implement --gc-sections. 2015-10-22 18:49:53 +00:00
Config.h [ELF][MIPS] Handle R_MIPS_HI16/LO16 relocations against _gp_disp symbol 2015-12-16 14:45:09 +00:00
Driver.cpp Factor out static members from DefinedRegular. 2015-12-25 06:12:18 +00:00
Driver.h Simplify the InputFile type hierarchy. 2015-10-12 01:55:32 +00:00
DriverUtils.cpp Update lld to match llvm r250901. OptTable constructor now takes an ArrayRef. NFC 2015-10-21 16:31:56 +00:00
Error.cpp [ELF2] Output of all unknown arguments instead of only one. 2015-09-24 18:55:33 +00:00
Error.h [ELF2] Output of all unknown arguments instead of only one. 2015-09-24 18:55:33 +00:00
InputFiles.cpp [ELF][MIPS] Implement R_MIPS_GPREL16/R_MIPS_GPREL32 relocations 2015-12-25 13:02:13 +00:00
InputFiles.h [ELF][MIPS] Implement R_MIPS_GPREL16/R_MIPS_GPREL32 relocations 2015-12-25 13:02:13 +00:00
InputSection.cpp [ELF][MIPS] Implement R_MIPS_GPREL16/R_MIPS_GPREL32 relocations 2015-12-25 13:02:13 +00:00
InputSection.h [ELF][MIPS] Implement R_MIPS_GPREL16/R_MIPS_GPREL32 relocations 2015-12-25 13:02:13 +00:00
LinkerScript.cpp [ELF] Lookup INPUT argument in the current directory 2015-11-26 20:23:46 +00:00
MarkLive.cpp Delete DefinedAbsolute. 2015-12-24 14:22:24 +00:00
Options.td Add --version-script= alias for --version-script 2015-12-10 14:08:45 +00:00
OutputSections.cpp Move a function to a file where it is used. 2015-12-25 07:01:09 +00:00
OutputSections.h Move a function to a file where it is used. 2015-12-25 07:01:09 +00:00
README.md [README] Update to reflect the new world order. 2015-12-24 10:03:46 +00:00
SymbolTable.cpp Factor out static members from DefinedRegular. 2015-12-25 06:12:18 +00:00
SymbolTable.h Simplify memory management. 2015-12-23 14:35:51 +00:00
Symbols.cpp Factor out static members from DefinedRegular. 2015-12-25 06:12:18 +00:00
Symbols.h Add comments. 2015-12-25 06:55:39 +00:00
Target.cpp [ELF][MIPS] Implement R_MIPS_GPREL16/R_MIPS_GPREL32 relocations 2015-12-25 13:02:13 +00:00
Target.h [ELF] - Implemented R_*_IRELATIVE relocations for x86, x64 targets. 2015-12-21 10:12:06 +00:00
Writer.cpp Fixed MSVS warning "not all control paths return a value". NFC. 2015-12-25 11:15:26 +00:00
Writer.h ELF2: Implement --gc-sections. 2015-10-22 18:49:53 +00:00

README.md

The New ELF Linker

This directory contains a port of the new PE/COFF linker for ELF.

Overall Design

See COFF/README.md for details on the design. Note that unlike COFF, we do not distinguish chunks from input sections; they are merged together.

Capabilities

This linker can link LLVM and Clang on Linux/x86-64 or FreeBSD/x86-64 "Hello world" can be linked on Linux/PPC64 and on Linux/AArch64 or FreeBSD/AArch64.

Performance

Achieving good performance is one of our goals. It's too early to reach a conclusion, but we are optimistic about that as it currently seems to be faster than GNU gold. It will be interesting to compare when we are close to feature parity.