From 70697f52b37061d4ca92838b13cd03893285ebd7 Mon Sep 17 00:00:00 2001 From: rpaulo Date: Thu, 26 Aug 2010 13:04:16 +0000 Subject: Mark __DTOR_LIST__, __EH_FRAME_BEGIN__ and __CTOR_END__ as used to avoid segfaults when building with clang. This comes (partly) from the LLVM svn r41105. --- contrib/gcc/crtstuff.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'contrib/gcc') diff --git a/contrib/gcc/crtstuff.c b/contrib/gcc/crtstuff.c index be41d96..d4f54b9 100644 --- a/contrib/gcc/crtstuff.c +++ b/contrib/gcc/crtstuff.c @@ -191,11 +191,11 @@ DTOR_LIST_BEGIN; #elif defined(DTORS_SECTION_ASM_OP) asm (DTORS_SECTION_ASM_OP); STATIC func_ptr __DTOR_LIST__[1] - __attribute__ ((aligned(sizeof(func_ptr)))) + __attribute__ ((used, aligned(sizeof(func_ptr)))) = { (func_ptr) (-1) }; #else STATIC func_ptr __DTOR_LIST__[1] - __attribute__((section(".dtors"), aligned(sizeof(func_ptr)))) + __attribute__((used, section(".dtors"), aligned(sizeof(func_ptr)))) = { (func_ptr) (-1) }; #endif /* __DTOR_LIST__ alternatives */ @@ -203,7 +203,7 @@ STATIC func_ptr __DTOR_LIST__[1] /* Stick a label at the beginning of the frame unwind info so we can register and deregister it with the exception handling library code. */ STATIC EH_FRAME_SECTION_CONST char __EH_FRAME_BEGIN__[] - __attribute__((section(EH_FRAME_SECTION_NAME), aligned(4))) + __attribute__((used, section(EH_FRAME_SECTION_NAME), aligned(4))) = { }; #endif /* USE_EH_FRAME_REGISTRY */ @@ -459,11 +459,11 @@ CTOR_LIST_END; static func_ptr force_to_data[1] __attribute__ ((__used__)) = { }; asm (CTORS_SECTION_ASM_OP); STATIC func_ptr __CTOR_END__[1] - __attribute__((aligned(sizeof(func_ptr)))) + __attribute__((used, aligned(sizeof(func_ptr)))) = { (func_ptr) 0 }; #else STATIC func_ptr __CTOR_END__[1] - __attribute__((section(".ctors"), aligned(sizeof(func_ptr)))) + __attribute__((used, section(".ctors"), aligned(sizeof(func_ptr)))) = { (func_ptr) 0 }; #endif -- cgit v1.1