Skip to content
Commit 05600506 authored by Simon Atanasyan's avatar Simon Atanasyan
Browse files

[ELF][MIPS] Fix calculation of GP relative relocations in case of relocatable output

Some MIPS relocations depend on "gp" value. By default, this value has
0x7ff0 offset from a .got section. But relocatable files produced by a
compiler or a linker might redefine this default value and we have to
use it for a calculation of the relocation result. When we generate EXE
or DSO it's trivial. Generating a relocatable output is more difficult
case because the linker does calculate relocations in this case and
cannot store individual "gp" values used by each input object file.
As a workaround we add the "gp" value to the relocation addend.

This fixes https://llvm.org/pr31149

Differential revision: https://reviews.llvm.org/D45972

llvm-svn: 331772
parent c7113cc9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment