From 1a92d941b3541f0c361caad499d0eb37a8339453 Mon Sep 17 00:00:00 2001 From: Lauro Ramos Venancio Date: Fri, 26 Jan 2007 19:51:32 +0000 Subject: [PATCH] If the constant pool value is a extern weak symbol, emit the weak reference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33543 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMAsmPrinter.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index c1946ded145..de12dfa7c95 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/ARMAsmPrinter.cpp @@ -121,7 +121,8 @@ namespace { printDataDirective(MCPV->getType()); ARMConstantPoolValue *ACPV = (ARMConstantPoolValue*)MCPV; - std::string Name = Mang->getValueName(ACPV->getGV()); + GlobalValue *GV = ACPV->getGV(); + std::string Name = Mang->getValueName(GV); if (ACPV->isNonLazyPointer()) { GVNonLazyPtrs.insert(Name); O << TAI->getPrivateGlobalPrefix() << Name << "$non_lazy_ptr"; @@ -132,6 +133,11 @@ namespace { << utostr(ACPV->getLabelId()) << "+" << (unsigned)ACPV->getPCAdjustment() << ")"; O << "\n"; + + // If the constant pool value is a extern weak symbol, remember to emit + // the weak reference. + if (GV->hasExternalWeakLinkage()) + ExtWeakSymbols.insert(GV); } void getAnalysisUsage(AnalysisUsage &AU) const {