Commit Graph

3 Commits

Author SHA1 Message Date
Rafael Espindola 06cb7c8773 Simplify processRelocAux.
It returns a different Expr only in the case of creating a function
symbol pointing to its plt entry. We can just add a call to
addPltEntry to avoid that and return void.

With this patch further simplifications of how we handle copy
relocations are possible.

llvm-svn: 330960
2018-04-26 17:22:44 +00:00
Rafael Espindola 4b6833332b Rewrite our relocation processing.
This splits relocation processing in two steps.

First, analyze what needs to be done at the relocation spot. This can
be a constant (non preemptible symbol, relative got reference, etc) or
require a dynamic relocation. At this step we also consider creating
copy relocations.

Once that is done we decide if we need a got or a plt entry.

The code is simpler IMHO. For example:

- There is a single call to isPicRel since the logic is not split
  among adjustExpr and the caller.
- R_MIPS_GOTREL is simple to handle now.
- The tracking of what is preemptible or not is much simpler now.

This also fixes a regression with symbols being both in a got and copy
relocated. They had regressed in r268668 and r268149.

The other test changes are because of error messages changes or the
order of two relocations in the output.

llvm-svn: 322047
2018-01-09 00:13:54 +00:00
Rafael Espindola 615a064e33 Document a change of behavior in r315552.
We used to reject this, but we now accept. The output seems
reasonable, so this is probably an OK extension over bfd/gold.

llvm-svn: 316376
2017-10-23 21:00:15 +00:00