Fix for ARM weak symbols, patch by Lauro Ramos Venancio!
authorChris Lattner <sabre@nondot.org>
Thu, 21 Dec 2006 22:59:58 +0000 (22:59 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 21 Dec 2006 22:59:58 +0000 (22:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32740 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMAsmPrinter.cpp

index d4c6634214a0c6cfb9d748a83c6f6234d0397c33..653d5007ab98cfb0acbdf45153c440e7d7ebebd5 100644 (file)
@@ -111,6 +111,20 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   // Print out constants referenced by the function
   EmitConstantPool(MF.getConstantPool());
 
+  const std::vector<MachineConstantPoolEntry>
+    &CP = MF.getConstantPool()->getConstants();
+  for (unsigned i = 0, e = CP.size(); i != e; ++i) {
+    MachineConstantPoolEntry CPE = CP[i];
+    if (!CPE.isMachineConstantPoolEntry()){
+      Constant *CV = CPE.Val.ConstVal;
+      if (const GlobalValue *GV = dyn_cast<GlobalValue>(CV)) {
+        if (GV->hasExternalWeakLinkage()) {
+          ExtWeakSymbols.insert(GV);
+        }
+      }
+    }
+  }
+
   // Print out jump tables referenced by the function
   EmitJumpTableInfo(MF.getJumpTableInfo(), MF);