Ensure .AliasedSymbol() is called on all uses of getSymbol(). Affects ARM and MIPS ELF backends.

Fixes PR11877



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149180 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
James Molloy 2012-01-28 15:58:32 +00:00
parent 518ff566f5
commit 2d8955a77c
4 changed files with 14 additions and 2 deletions

View File

@ -69,7 +69,7 @@ const MCSymbol *ARMELFObjectWriter::ExplicitRelSym(const MCAssembler &Asm,
const MCFragment &F,
const MCFixup &Fixup,
bool IsPCRel) const {
const MCSymbol &Symbol = Target.getSymA()->getSymbol();
const MCSymbol &Symbol = Target.getSymA()->getSymbol().AliasedSymbol();
bool EmitThisSym = false;
const MCSectionELF &Section =

View File

@ -53,7 +53,7 @@ const MCSymbol *MipsELFObjectWriter::ExplicitRelSym(const MCAssembler &Asm,
const MCFixup &Fixup,
bool IsPCRel) const {
assert(Target.getSymA() && "SymA cannot be 0.");
const MCSymbol &Sym = Target.getSymA()->getSymbol();
const MCSymbol &Sym = Target.getSymA()->getSymbol().AliasedSymbol();
if (Sym.getSection().getKind().isMergeableCString() ||
Sym.getSection().getKind().isMergeableConst())

6
test/MC/ARM/pr11877.s Normal file
View File

@ -0,0 +1,6 @@
// RUN: llvm-mc -triple arm-unknown-unknown %s
i:
.long g
g = h
h = i

6
test/MC/Mips/pr11877.s Normal file
View File

@ -0,0 +1,6 @@
// RUN: llvm-mc -triple mips-unknown-unknown %s
i:
.long g
g = h
h = i