1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00
Simon Atanasyan 493b163f5d [mips] Do not include offset into %got expression for global symbols
Now pseudo instruction `la $6, symbol+8($6)` is expanding into the following
chain of commands:
```
lw    $1, %got(symbol+8)($gp)
addiu $1, $1, 8
addu  $6, $1, $6
```

This is incorrect. When a linker handles the `R_MIPS_GOT16` relocation,
it does not expect to get any addend and breaks on assertion. Otherwise
it has to create new GOT entry for each unique "sym + offset" pair.
Offset for a global symbol should be added to result of loading GOT
entry by a separate `add` command.

The patch fixes the problem by stripping off an offset from the expression
passed to the `%got`. That's interesting that even current code inserts
a separate `add` command.

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

llvm-svn: 369755
2019-08-23 13:36:14 +00:00
..
2018-08-29 11:35:03 +00:00
2018-08-29 11:35:03 +00:00
2019-07-17 08:11:31 +00:00
2016-04-08 18:15:37 +00:00
2016-04-08 18:15:37 +00:00
2016-04-08 18:15:37 +00:00
2017-10-10 13:34:45 +00:00
2017-05-30 09:33:43 +00:00
2017-01-22 20:28:56 +00:00
2017-05-30 09:33:43 +00:00
2016-11-21 20:30:41 +00:00
2017-12-11 11:21:40 +00:00