From ebd063486fc717748793e6a0a99efa40f170f19b Mon Sep 17 00:00:00 2001 From: andrew Date: Sat, 15 Dec 2012 21:24:31 +0000 Subject: Don't define CTORS_SECTION_ASM_OP and DTORS_SECTION_ASM_OP on arm when built with clang. When these are defined the lists are defined similar to: asm(".section .ctors"); STATIC func_ptr __CTOR_LIST__[1] = { (func_ptr) (-1) }; asm(".section .dtors"); STATIC func_ptr __DTOR_LIST__[1] = { (func_ptr) (-1) }; The problem is clang will move the two arrays out of the .ctors and .dtors sections causing these sections to contain a single null address. By not defining these macros we use the version of the code that places the arrays is their sections by using __attribute__((section(".ctors"))) and similar for .dtors. Submitted by: Daisuke Aoyama --- contrib/gcc/config/arm/arm.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'contrib/gcc') diff --git a/contrib/gcc/config/arm/arm.h b/contrib/gcc/config/arm/arm.h index 20a869f..89b8a38 100644 --- a/contrib/gcc/config/arm/arm.h +++ b/contrib/gcc/config/arm/arm.h @@ -1866,8 +1866,10 @@ typedef struct # define DTOR_LIST_BEGIN asm (ARM_EABI_DTORS_SECTION_OP) # define DTOR_LIST_END /* empty */ # else /* !defined (__ARM_EABI__) */ +# ifndef __clang__ # define CTORS_SECTION_ASM_OP ARM_CTORS_SECTION_OP # define DTORS_SECTION_ASM_OP ARM_DTORS_SECTION_OP +# endif # endif /* !defined (__ARM_EABI__) */ #endif /* !defined (IN_LIBCC2) */ -- cgit v1.1