From: Davide Italiano Date: Fri, 17 Jun 2016 18:20:14 +0000 (+0000) Subject: [IRObjectFile] Handle .weak in RecordStreamer. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f57147f09b614a7d4d6c32d00fb4e285319ee8cd;p=llvm [IRObjectFile] Handle .weak in RecordStreamer. Differential Revision: http://reviews.llvm.org/D21476 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273027 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Object/RecordStreamer.cpp b/lib/Object/RecordStreamer.cpp index 42dbd3e0c2d..74d57dee2da 100644 --- a/lib/Object/RecordStreamer.cpp +++ b/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/test/Object/X86/nm-bitcodeweak.test b/test/Object/X86/nm-bitcodeweak.test new file mode 100644 index 00000000000..19af95f1ae8 --- /dev/null +++ b/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"