From: James Molloy Date: Sat, 28 Jan 2012 15:58:32 +0000 (+0000) Subject: Ensure .AliasedSymbol() is called on all uses of getSymbol(). Affects ARM and MIPS... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2d8955a77c6920d1a50de5ec9094faaa1b2f4e88;p=oota-llvm.git 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 --- diff --git a/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp b/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp index 2ad64de9886..7d44ddafeae 100644 --- a/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp +++ b/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp @@ -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 = diff --git a/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp b/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp index 9c2f81e596f..196e17fefab 100644 --- a/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp +++ b/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp @@ -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()) diff --git a/test/MC/ARM/pr11877.s b/test/MC/ARM/pr11877.s new file mode 100644 index 00000000000..da3f6ad1d8e --- /dev/null +++ b/test/MC/ARM/pr11877.s @@ -0,0 +1,6 @@ +// RUN: llvm-mc -triple arm-unknown-unknown %s + +i: + .long g +g = h +h = i diff --git a/test/MC/Mips/pr11877.s b/test/MC/Mips/pr11877.s new file mode 100644 index 00000000000..d354ce4c554 --- /dev/null +++ b/test/MC/Mips/pr11877.s @@ -0,0 +1,6 @@ +// RUN: llvm-mc -triple mips-unknown-unknown %s + +i: + .long g +g = h +h = i