summaryrefslogtreecommitdiffstats
path: root/contrib/gcc
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2010-08-26 13:04:16 +0000
committerrpaulo <rpaulo@FreeBSD.org>2010-08-26 13:04:16 +0000
commit70697f52b37061d4ca92838b13cd03893285ebd7 (patch)
tree3943f86bb608f0a480fbc3186adc9164eaab85df /contrib/gcc
parentc64123a2cb0e849de394f575da5c492af9104e42 (diff)
downloadFreeBSD-src-70697f52b37061d4ca92838b13cd03893285ebd7.zip
FreeBSD-src-70697f52b37061d4ca92838b13cd03893285ebd7.tar.gz
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.
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/crtstuff.c10
1 files changed, 5 insertions, 5 deletions
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
OpenPOWER on IntegriCloud