[llvm] r273027 - [IRObjectFile] Handle .weak in RecordStreamer.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 17 11:20:15 PDT 2016
Author: davide
Date: Fri Jun 17 13:20:14 2016
New Revision: 273027
URL: http://llvm.org/viewvc/llvm-project?rev=273027&view=rev
Log:
[IRObjectFile] Handle .weak in RecordStreamer.
Differential Revision: http://reviews.llvm.org/D21476
Added:
llvm/trunk/test/Object/X86/nm-bitcodeweak.test
Modified:
llvm/trunk/lib/Object/RecordStreamer.cpp
Modified: llvm/trunk/lib/Object/RecordStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/RecordStreamer.cpp?rev=273027&r1=273026&r2=273027&view=diff
==============================================================================
--- llvm/trunk/lib/Object/RecordStreamer.cpp (original)
+++ llvm/trunk/lib/Object/RecordStreamer.cpp Fri Jun 17 13:20:14 2016
@@ -84,7 +84,7 @@ void RecordStreamer::EmitAssignment(MCSy
bool RecordStreamer::EmitSymbolAttribute(MCSymbol *Symbol,
MCSymbolAttr Attribute) {
- if (Attribute == MCSA_Global)
+ if (Attribute == MCSA_Global || Attribute == MCSA_Weak)
markGlobal(*Symbol);
return true;
}
Added: llvm/trunk/test/Object/X86/nm-bitcodeweak.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/X86/nm-bitcodeweak.test?rev=273027&view=auto
==============================================================================
--- llvm/trunk/test/Object/X86/nm-bitcodeweak.test (added)
+++ llvm/trunk/test/Object/X86/nm-bitcodeweak.test Fri Jun 17 13:20:14 2016
@@ -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"
More information about the llvm-commits
mailing list