From 8d6fbc3a4e92398bd1f50d9a3c731dde292c7587 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 29 Feb 2016 14:26:06 +0000 Subject: [PATCH] IRObject: Mark extern_weak as weak. llvm-svn: 262222 --- llvm/lib/Object/IRObjectFile.cpp | 3 ++- llvm/test/Object/X86/nm-ir.ll | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Object/IRObjectFile.cpp b/llvm/lib/Object/IRObjectFile.cpp index 8b84648..5548a38 100644 --- a/llvm/lib/Object/IRObjectFile.cpp +++ b/llvm/lib/Object/IRObjectFile.cpp @@ -231,7 +231,8 @@ uint32_t IRObjectFile::getSymbolFlags(DataRefImpl Symb) const { Res |= BasicSymbolRef::SF_Global; if (GV->hasCommonLinkage()) Res |= BasicSymbolRef::SF_Common; - if (GV->hasLinkOnceLinkage() || GV->hasWeakLinkage()) + if (GV->hasLinkOnceLinkage() || GV->hasWeakLinkage() || + GV->hasExternalWeakLinkage()) Res |= BasicSymbolRef::SF_Weak; if (GV->getName().startswith("llvm.")) diff --git a/llvm/test/Object/X86/nm-ir.ll b/llvm/test/Object/X86/nm-ir.ll index d517b09..1742a8f 100644 --- a/llvm/test/Object/X86/nm-ir.ll +++ b/llvm/test/Object/X86/nm-ir.ll @@ -6,6 +6,7 @@ ; CHECK-NEXT: t f2 ; CHECK-NEXT: W f3 ; CHECK-NEXT: U f4 +; CHECK-NEXT: w f5 ; CHECK-NEXT: D g1 ; CHECK-NEXT: d g2 ; CHECK-NEXT: C g3 @@ -31,6 +32,7 @@ module asm ".long undef_asm_sym" @a2 = internal alias i32, i32* @g1 define void @f1() { + call void @f5() ret void } @@ -43,3 +45,5 @@ define linkonce_odr void @f3() { } declare void @f4() + +declare extern_weak void @f5() -- 2.7.4