summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Davis <cdavis5x@gmail.com>2018-08-31 18:11:48 +0000
committerCharles Davis <cdavis5x@gmail.com>2018-08-31 18:11:48 +0000
commit5598288131bddd69f39c75ae61fba23a4b8cf80e (patch)
tree2620083ed107b97b8715d2b3613c6215b23dd75c
parentd743159ded798c009c24b513d586e2894d7494df (diff)
downloadlibunwind_llvm-5598288131bddd69f39c75ae61fba23a4b8cf80e.tar.gz
Export public functions implemented in assembly on Windows.
Summary: By default, symbols aren't visible outside of the module that defines them. To make them visible, they must be exported. The easiest way to do that is to embed an `-export:symname` directive into the object file. Reviewers: mstorsjo, rnk Subscribers: christof, cfe-commits Differential Revision: https://reviews.llvm.org/D51508 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@341232 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--src/assembly.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/assembly.h b/src/assembly.h
index 07b08f9..e98ad40 100644
--- a/src/assembly.h
+++ b/src/assembly.h
@@ -44,6 +44,7 @@
#if defined(__APPLE__)
#define SYMBOL_IS_FUNC(name)
+#define EXPORT_SYMBOL(name)
#define HIDDEN_SYMBOL(name) .private_extern name
#define NO_EXEC_STACK_DIRECTIVE
@@ -54,6 +55,7 @@
#else
#define SYMBOL_IS_FUNC(name) .type name,@function
#endif
+#define EXPORT_SYMBOL(name)
#define HIDDEN_SYMBOL(name) .hidden name
#if defined(__GNU__) || defined(__FreeBSD__) || defined(__Fuchsia__) || \
@@ -70,6 +72,11 @@
.scl 2 SEPARATOR \
.type 32 SEPARATOR \
.endef
+#define EXPORT_SYMBOL2(name) \
+ .section .drectve,"yn" SEPARATOR \
+ .ascii "-export:", #name, "\0" SEPARATOR \
+ .text
+#define EXPORT_SYMBOL(name) EXPORT_SYMBOL2(name)
#define HIDDEN_SYMBOL(name)
#define NO_EXEC_STACK_DIRECTIVE
@@ -82,6 +89,7 @@
#define DEFINE_LIBUNWIND_FUNCTION(name) \
.globl SYMBOL_NAME(name) SEPARATOR \
+ EXPORT_SYMBOL(name) SEPARATOR \
SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \
SYMBOL_NAME(name):