From d9dbecd74d7849a97bbec9bf7d484b498402020a Mon Sep 17 00:00:00 2001 From: Jonathan Roelofs Date: Fri, 1 Aug 2014 22:02:21 +0000 Subject: [PATCH] [unwinder] Tell the assembler that functions are functions so that the linker knows how to link them. This fixes an interworking problem when the unwinder/libcxxabi is built for Thumb. When unw_getcontext is not marked as a function, 'bl' is used for the branch instead of 'bx'. llvm-svn: 214573 --- libcxxabi/src/Unwind/assembly.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libcxxabi/src/Unwind/assembly.h b/libcxxabi/src/Unwind/assembly.h index 210d350..c2e2ba5 100644 --- a/libcxxabi/src/Unwind/assembly.h +++ b/libcxxabi/src/Unwind/assembly.h @@ -34,13 +34,32 @@ #define GLUE(a, b) GLUE2(a, b) #define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name) +#if defined(__APPLE__) +#define SYMBOL_IS_FUNC(name) +#elif defined(__ELF__) +#define LOCAL_LABEL(name) .L_##name +#if defined(__arm__) +#define SYMBOL_IS_FUNC(name) .type name,%function +#else +#define SYMBOL_IS_FUNC(name) .type name,@function +#endif +#else +#define SYMBOL_IS_FUNC(name) \ + .def name SEPARATOR \ + .scl 2 SEPARATOR \ + .type 32 SEPARATOR \ + .endef +#endif + #define DEFINE_LIBUNWIND_FUNCTION(name) \ .globl SYMBOL_NAME(name) SEPARATOR \ + SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \ SYMBOL_NAME(name): #define DEFINE_LIBUNWIND_PRIVATE_FUNCTION(name) \ .globl SYMBOL_NAME(name) SEPARATOR \ HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR \ + SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \ SYMBOL_NAME(name): #endif /* UNWIND_ASSEMBLY_H */ -- 2.7.4