Commit Graph

10 Commits

Author SHA1 Message Date
Simon Atanasyan 7644191fb1 [MIPS] Convert template parameters to function arguments. NFC
Pass BSIZE and SHIFT as a function arguments to the `writeRelocation`
routine. It does not make a sense to have so many `writeRelocation's`
instances.

llvm-svn: 312495
2017-09-04 16:16:46 +00:00
Simon Atanasyan 351cf49579 [MIPS] Add curly brackets to improve code readability. NFC.
llvm-svn: 312494
2017-09-04 16:16:41 +00:00
Simon Atanasyan 3876077ac7 [MIPS] Remove unused function's argument. NFC
llvm-svn: 311889
2017-08-28 14:40:53 +00:00
Simon Atanasyan 1998f859dc [MIPS] Merge multiple functions for writing relocation result into the single one. NFC
llvm-svn: 311712
2017-08-24 21:57:03 +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
Simon Atanasyan 204cae99bb [MIPS] Remove redundant function getPcRelocAddend. NFC
llvm-svn: 311710
2017-08-24 21:56:52 +00:00
Rafael Espindola 3bab91332f Fix which file is in an error message.
When reporting an invalid relocation we were blaming the destination
file instead of the file with the relocation.

llvm-svn: 310084
2017-08-04 18:33:16 +00:00
Rui Ueyama 921d43fbb2 Add trap instructions for ARM and MIPS.
This patch fills holes in executable sections with 0xd4 (ARM) or
0xef (MIPS). These trap instructions were suggested by Theo de Raadt.

llvm-svn: 306322
2017-06-26 19:45:53 +00:00
Rui Ueyama e145bc22fd Do not use make<> to allocate TargetInfo. NFC.
llvm-svn: 305577
2017-06-16 20:15:03 +00:00
Rui Ueyama 21c0a9ceeb Split Target.cpp into small files.
Target.cpp contains code for all the targets that LLD supports. It was
simple and easy, but as the number of supported targets increased,
it got messy.

This patch splits the file into per-target files under ELF/arch directory.

Differential Revision: https://reviews.llvm.org/D34222

llvm-svn: 305565
2017-06-16 17:32:43 +00:00