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

Fixes PR11877

llvm-svn: 149180
This commit is contained in:
James Molloy 2012-01-28 15:58:32 +00:00
parent 4efe5064c3
commit b47489d4ef
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())

View File

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

View File

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