From 6bf108d77a3c15f2bd47a8fa21e8e9357f873a70 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 7 May 2019 23:06:21 +0000 Subject: [COFF] Use COFF stubs for extern_weak functions Summary: A COFF stub indirects the reference to a symbol through memory. A .refptr.$sym global variable pointer is created to refer to $sym. Typically mingw uses these for external global variable declarations, but we can use them for weak function declarations as well. Updates the dso_local classification to add a special case for extern_weak symbols on COFF in both clang and LLVM. Fixes PR37598 Reviewers: smeenai, mstorsjo Subscribers: hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D61615 llvm-svn: 360207 --- clang/test/CodeGen/dso-local-executable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/test/CodeGen/dso-local-executable.c') diff --git a/clang/test/CodeGen/dso-local-executable.c b/clang/test/CodeGen/dso-local-executable.c index 36fd4d0d039..13e11158300 100644 --- a/clang/test/CodeGen/dso-local-executable.c +++ b/clang/test/CodeGen/dso-local-executable.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-pc-win32 -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix=COFF %s // COFF-DAG: @bar = external dso_local global i32 -// COFF-DAG: @weak_bar = extern_weak dso_local global i32 +// COFF-DAG: @weak_bar = extern_weak global i32 // COFF-DAG: declare dso_local void @foo() // COFF-DAG: @baz = dso_local global i32 42 // COFF-DAG: define dso_local i32* @zed() -- cgit v1.2.3