diff options
| author | Daniel Sanders <daniel.sanders@imgtec.com> | 2016-05-12 13:39:13 +0000 |
|---|---|---|
| committer | Daniel Sanders <daniel.sanders@imgtec.com> | 2016-05-12 13:39:13 +0000 |
| commit | 5fb391c893073547f546a88f461a0de15924c55b (patch) | |
| tree | 0bcd281964c87cba887f2148c7c813a2b1aa2925 /llvm/lib | |
| parent | 3a0736e279bbcde85c2d7ed026861600469a9eb7 (diff) | |
| download | bcm5719-llvm-5fb391c893073547f546a88f461a0de15924c55b.tar.gz bcm5719-llvm-5fb391c893073547f546a88f461a0de15924c55b.zip | |
[mips][ias] Work around incorrect another microMIPS relocation evaluation exposed by r268900
As explained in r269196, microMIPS has a special case that is not correctly
implemented in LLVM. If we have a symbol 'foo' which is equivalent to
'.text+0x10'. The value of an R_MICROMIPS_LO16 relocation using 'foo' is
'foo+0x11' and not 'foo+0x10'. The in-place addend should therefore be 0x11.
This commit reverts a little more of the effect of r268900 by keeping the
symbol when the STO_MIPS_MICROMIPS flag is set for R_MIPS_GPREL32 relocations.
This fixes SingleSource/UnitTests/2003-08-11-VaListArg, and
SingleSource/UnitTests/2003-05-07-VarArgs for microMIPS.
I believe there are additional relocations that have the same issue (e.g.
R_MIPS_64, and R_MIPS_GPREL16) but for now I'm focusing on restoring our
internal buildbots back to the green state we had in r268899.
llvm-svn: 269294
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp index e47868db1a4..a5e63856401 100644 --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp @@ -518,13 +518,13 @@ bool MipsELFObjectWriter::needsRelocateWithSymbol(const MCSymbol &Sym, case ELF::R_MIPS_16: case ELF::R_MIPS_32: + case ELF::R_MIPS_GPREL32: if (cast<MCSymbolELF>(Sym).getOther() & ELF::STO_MIPS_MICROMIPS) return true; // fallthrough case ELF::R_MIPS_26: case ELF::R_MIPS_64: case ELF::R_MIPS_GPREL16: - case ELF::R_MIPS_GPREL32: case ELF::R_MIPS_PC16: case ELF::R_MIPS_SUB: return false; |

