summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Object/RecordStreamer.cpp2
-rw-r--r--llvm/test/Object/X86/nm-bitcodeweak.test10
2 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/Object/RecordStreamer.cpp b/llvm/lib/Object/RecordStreamer.cpp
index 42dbd3e0c2d..74d57dee2da 100644
--- a/llvm/lib/Object/RecordStreamer.cpp
+++ b/llvm/lib/Object/RecordStreamer.cpp
@@ -84,7 +84,7 @@ void RecordStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
bool RecordStreamer::EmitSymbolAttribute(MCSymbol *Symbol,
MCSymbolAttr Attribute) {
- if (Attribute == MCSA_Global)
+ if (Attribute == MCSA_Global || Attribute == MCSA_Weak)
markGlobal(*Symbol);
return true;
}
diff --git a/llvm/test/Object/X86/nm-bitcodeweak.test b/llvm/test/Object/X86/nm-bitcodeweak.test
new file mode 100644
index 00000000000..19af95f1ae8
--- /dev/null
+++ b/llvm/test/Object/X86/nm-bitcodeweak.test
@@ -0,0 +1,10 @@
+; RUN: llvm-as %s -o=%t1
+; RUN: llvm-nm %t1 | FileCheck %s
+
+; CHECK: T __libc_blah
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-freebsd11.0"
+
+module asm ".weak __libc_blah"
+module asm ".equ __libc_blah, blah"
OpenPOWER on IntegriCloud