Commit Graph

5 Commits

Author SHA1 Message Date
Fangrui Song eb75b8f8f7 [ELF] Move `# REQUIRES:` line to the top
llvm-svn: 335625
2018-06-26 16:58:19 +00:00
Simon Atanasyan c5455e237f [MIPS] Keep all code read addends in the `getImplicitAddend` function
Currently LLD reads the R_MIPS_HI16's addends in the `computeMipsAddend`
function, the R_MIPS_LO16's addends in both `computeMipsAddend` and
`getImplicitAddend` functions. This patch moves reading all addends to
the `getImplicitAddend` function. As a side effect it fixes a "paired"
HI16/LO16 addend calculation if "LO16" part of a pair is not found.

llvm-svn: 311711
2017-08-24 21:56:58 +00:00
George Rimar ca1d1fb2d6 Error/warning/log messages should start with lowercase letters.
llvm-svn: 263549
2016-03-15 14:00:22 +00:00
Simon Atanasyan dddbeb7a46 [ELF][MIPS] Match paired relocation using relocation type and symbol index
If we have R_MIPS_HI16 relocation, the paired relocation is the next
R_MIPS_LO16 relocation with the same symbol as a target.

llvm-svn: 255452
2015-12-13 06:49:08 +00:00
Simon Atanasyan 09b3e3685f [ELF] MIPS paired R_MIPS_HI16/LO16 relocations support
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
2015-12-01 21:24:45 +00:00