summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/WinCOFFObjectWriter.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2013-07-15 19:41:21 +0000
committerReid Kleckner <reid@kleckner.net>2013-07-15 19:41:21 +0000
commitdae7b4e4d1d23d588438e8c5eb3f7d28b90f2d2a (patch)
treef02e7f75b92af01eeb6f783bee3bb834f28d9473 /llvm/lib/MC/WinCOFFObjectWriter.cpp
parent79656e19c8b8919f461367f5c03c3eb27be5548b (diff)
downloadbcm5719-llvm-dae7b4e4d1d23d588438e8c5eb3f7d28b90f2d2a.tar.gz
bcm5719-llvm-dae7b4e4d1d23d588438e8c5eb3f7d28b90f2d2a.zip
[mc-coff] Resolve aliases when emitting COFF relocations
This is consistent with the ELF object writer. Add some COFF tests that relocate against an alias. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D1079 llvm-svn: 186341
Diffstat (limited to 'llvm/lib/MC/WinCOFFObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/WinCOFFObjectWriter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/MC/WinCOFFObjectWriter.cpp b/llvm/lib/MC/WinCOFFObjectWriter.cpp
index cf733960881..28e611f6d73 100644
--- a/llvm/lib/MC/WinCOFFObjectWriter.cpp
+++ b/llvm/lib/MC/WinCOFFObjectWriter.cpp
@@ -637,8 +637,9 @@ void WinCOFFObjectWriter::RecordRelocation(const MCAssembler &Asm,
uint64_t &FixedValue) {
assert(Target.getSymA() != NULL && "Relocation must reference a symbol!");
- const MCSymbol *A = &Target.getSymA()->getSymbol();
- MCSymbolData &A_SD = Asm.getSymbolData(*A);
+ const MCSymbol &Symbol = Target.getSymA()->getSymbol();
+ const MCSymbol &A = Symbol.AliasedSymbol();
+ MCSymbolData &A_SD = Asm.getSymbolData(A);
MCSectionData const *SectionData = Fragment->getParent();
OpenPOWER on IntegriCloud