09b3e3685f
Some MIPS relocations including `R_MIPS_HI16/R_MIPS_LO16` use combined addends. Such addend is calculated using addends of both paired relocations. Each `R_MIPS_HI16` relocation is paired with the next `R_MIPS_LO16` relocation. ABI requires to compute such combined addend in case of REL relocation record format only. For details see p. 4-17 at ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf This patch implements lookup of the next paired relocation suing new `InputSectionBase::findPairedRelocLocation` method. The primary disadvantage of this approach is that we put MIPS specific logic into the common code. The next disadvantage is that we lookup `R_MIPS_LO16` for each `R_MIPS_HI16` relocation, while in fact multiple `R_MIPS_HI16` might be paired with the single `R_MIPS_LO16`. From the other side this way allows us to keep `MipsTargetInfo` class stateless and implement later relocation handling in parallel. This patch does not support `R_MIPS_HI16/R_MIPS_LO16` relocations against `_gp_disp` symbol. In that case the relocations use a special formula for the calculation. That will be implemented later. Differential Revision: http://reviews.llvm.org/D15112 llvm-svn: 254461 |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
Config.h | ||
Driver.cpp | ||
Driver.h | ||
DriverUtils.cpp | ||
Error.cpp | ||
Error.h | ||
InputFiles.cpp | ||
InputFiles.h | ||
InputSection.cpp | ||
InputSection.h | ||
LinkerScript.cpp | ||
MarkLive.cpp | ||
Options.td | ||
OutputSections.cpp | ||
OutputSections.h | ||
README.md | ||
SymbolTable.cpp | ||
SymbolTable.h | ||
Symbols.cpp | ||
Symbols.h | ||
Target.cpp | ||
Target.h | ||
Writer.cpp | ||
Writer.h |
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 with -LLVM_ENABLE_THREADS=OFF. "Hello world" can be linked on Linux/PPC64.
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.