[libcxxabi] r214573 - [unwinder] Tell the assembler that functions are functions so that the linker knows how to link them.
Jonathan Roelofs
jonathan at codesourcery.com
Tue Aug 5 08:42:57 PDT 2014
On 8/2/14, 4:01 PM, Saleem Abdulrasool wrote:
> On Fri, Aug 1, 2014 at 3:02 PM, Jonathan Roelofs <jonathan at codesourcery.com
> <mailto:jonathan at codesourcery.com>> wrote:
>
> Author: jroelofs
> Date: Fri Aug 1 17:02:21 2014
> New Revision: 214573
>
> URL: http://llvm.org/viewvc/llvm-project?rev=214573&view=rev
> Log:
> [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'.
>
> Modified:
> libcxxabi/trunk/src/Unwind/assembly.h
>
> Modified: libcxxabi/trunk/src/Unwind/assembly.h
> URL:
> http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/assembly.h?rev=214573&r1=214572&r2=214573&view=diff
> ==============================================================================
> --- libcxxabi/trunk/src/Unwind/assembly.h (original)
> +++ libcxxabi/trunk/src/Unwind/assembly.h Fri Aug 1 17:02:21 2014
> @@ -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
>
>
> Why is defined for ELF only? Was this just an accidental copy?
Oops. Fixed in r214873.
Thanks!
Jon
>
> +#if defined(__arm__)
> +#define SYMBOL_IS_FUNC(name) .type name,%function
> +#else
> +#define SYMBOL_IS_FUNC(name) .type name, at 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 */
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu <mailto:cfe-commits at cs.uiuc.edu>
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
>
>
> --
> Saleem Abdulrasool
> compnerd (at) compnerd (dot) org
--
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded
More information about the cfe-commits
mailing list