diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-05-01 11:32:44 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-05-01 11:32:44 +0000 |
commit | 9e197ff9cac64ddc01b685142b9a42b4058c70b8 (patch) | |
tree | 3457e0b5f44dacc831e7fa01378845bfc63f299d | |
parent | de9dcb9448daa76b4ceaa1abaaed7dd2b5ec30b5 (diff) |
Sprinkle a few __used markers to prevent gcc4 from throwing away essential
bits of code and data. With this change gcc4 builds usable crt*.o on sparc64,
other architectures probably need some more love.
ok marco@, jsg@
-rw-r--r-- | lib/csu/common_elf/crtbegin.c | 10 | ||||
-rw-r--r-- | lib/csu/common_elf/crtbeginS.c | 10 | ||||
-rw-r--r-- | lib/csu/common_elf/crtend.c | 10 | ||||
-rw-r--r-- | lib/csu/common_elf/crtendS.c | 8 | ||||
-rw-r--r-- | lib/csu/sparc64/crt0.c | 4 |
5 files changed, 21 insertions, 21 deletions
diff --git a/lib/csu/common_elf/crtbegin.c b/lib/csu/common_elf/crtbegin.c index 64bf618e77c..95878e7db7f 100644 --- a/lib/csu/common_elf/crtbegin.c +++ b/lib/csu/common_elf/crtbegin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crtbegin.c,v 1.13 2009/04/13 20:15:24 kurt Exp $ */ +/* $OpenBSD: crtbegin.c,v 1.14 2010/05/01 11:32:43 kettenis Exp $ */ /* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */ /* @@ -89,8 +89,8 @@ static const init_f __CTOR_LIST__[1] static const init_f __DTOR_LIST__[1] __attribute__((section(".dtors"))) = { (void *)-1 }; /* XXX */ -static void __dtors(void); -static void __ctors(void); +static void __dtors(void) __used; +static void __ctors(void) __used; static void __dtors() @@ -119,8 +119,8 @@ __ctors() void __init(void); void __fini(void); -static void __do_init(void); -static void __do_fini(void); +static void __do_init(void) __used; +static void __do_fini(void) __used; MD_SECTION_PROLOGUE(".init", __init); diff --git a/lib/csu/common_elf/crtbeginS.c b/lib/csu/common_elf/crtbeginS.c index 80779c626c1..c4572e7591d 100644 --- a/lib/csu/common_elf/crtbeginS.c +++ b/lib/csu/common_elf/crtbeginS.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crtbeginS.c,v 1.10 2009/04/13 20:15:24 kurt Exp $ */ +/* $OpenBSD: crtbeginS.c,v 1.11 2010/05/01 11:32:43 kettenis Exp $ */ /* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */ /* @@ -78,8 +78,8 @@ static init_f __CTOR_LIST__[1] static init_f __DTOR_LIST__[1] __attribute__((section(".dtors"))) = { (void *)-1 }; /* XXX */ -static void __dtors(void); -static void __ctors(void); +static void __dtors(void) __used; +static void __ctors(void) __used; void __dtors(void) @@ -109,8 +109,8 @@ __ctors(void) } void _init(void); void _fini(void); -static void _do_init(void); -static void _do_fini(void); +static void _do_init(void) __used; +static void _do_fini(void) __used; MD_SECTION_PROLOGUE(".init", _init); diff --git a/lib/csu/common_elf/crtend.c b/lib/csu/common_elf/crtend.c index f26b95580ba..6f61be9afa8 100644 --- a/lib/csu/common_elf/crtend.c +++ b/lib/csu/common_elf/crtend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crtend.c,v 1.8 2009/07/14 16:37:31 jsg Exp $ */ +/* $OpenBSD: crtend.c,v 1.9 2010/05/01 11:32:43 kettenis Exp $ */ /* $NetBSD: crtend.c,v 1.1 1996/09/12 16:59:04 cgd Exp $ */ #include <sys/cdefs.h> @@ -6,16 +6,16 @@ #include "extern.h" static init_f __CTOR_LIST__[1] - __attribute__((section(".ctors"))) = { (void *)0 }; /* XXX */ + __used __attribute__((section(".ctors"))) = { (void *)0 }; /* XXX */ static init_f __DTOR_LIST__[1] - __attribute__((section(".dtors"))) = { (void *)0 }; /* XXX */ + __used __attribute__((section(".dtors"))) = { (void *)0 }; /* XXX */ static const int __EH_FRAME_END__[] -__attribute__((unused, section(".eh_frame"), aligned(4))) = { 0 }; + __used __attribute__((section(".eh_frame"), aligned(4))) = { 0 }; #if (__GNUC__ > 2) static void * __JCR_END__[] -__attribute__((unused, section(".jcr"), aligned(sizeof(void*)))) = { 0 }; + __used __attribute__((section(".jcr"), aligned(sizeof(void*)))) = { 0 }; #endif MD_SECTION_EPILOGUE(".init"); diff --git a/lib/csu/common_elf/crtendS.c b/lib/csu/common_elf/crtendS.c index 92493006494..cb41b9fcb49 100644 --- a/lib/csu/common_elf/crtendS.c +++ b/lib/csu/common_elf/crtendS.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crtendS.c,v 1.6 2009/04/13 20:15:24 kurt Exp $ */ +/* $OpenBSD: crtendS.c,v 1.7 2010/05/01 11:32:43 kettenis Exp $ */ /* $NetBSD: crtend.c,v 1.1 1997/04/16 19:38:24 thorpej Exp $ */ #include <sys/cdefs.h> @@ -6,13 +6,13 @@ #include "extern.h" static init_f __CTOR_LIST__[1] - __attribute__((section(".ctors"))) = { (void *)0 }; /* XXX */ + __used __attribute__((section(".ctors"))) = { (void *)0 }; /* XXX */ static init_f __DTOR_LIST__[1] - __attribute__((section(".dtors"))) = { (void *)0 }; /* XXX */ + __used __attribute__((section(".dtors"))) = { (void *)0 }; /* XXX */ #if (__GNUC__ > 2) static void * __JCR_END__[] -__attribute__((unused, section(".jcr"), aligned(sizeof(void*)))) = { 0 }; + __used __attribute__((section(".jcr"), aligned(sizeof(void*)))) = { 0 }; #endif MD_SECTION_EPILOGUE(".init"); diff --git a/lib/csu/sparc64/crt0.c b/lib/csu/sparc64/crt0.c index ee667dc8835..1bdcf09367b 100644 --- a/lib/csu/sparc64/crt0.c +++ b/lib/csu/sparc64/crt0.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crt0.c,v 1.7 2008/06/25 02:45:23 kurt Exp $ */ +/* $OpenBSD: crt0.c,v 1.8 2010/05/01 11:32:43 kettenis Exp $ */ /* * Copyright (c) 1995 Christopher G. Demetriou @@ -58,7 +58,7 @@ __asm__(".text\n" " ba,pt %icc, ___start\n" " nop"); -static void ___start(char **, void (*)(void), const void *); +static void ___start(char **, void (*)(void), const void *) __used; static void ___start(char **sp, void (*cleanup)(void), const void *obj) |