modified sources for portability compiler-rt

2009-10-17

author
Alexandre "kAworu" Perrin <kaworu(a)kaworu,ch>
date
Sat Oct 17 19:47:23 2009 +0200
branch
compiler-rt
changeset 12
e61a24f2988e
parent 11
dbc41bc0d6cb
child 14
6330fd2b04ee

modified sources for portability

crtbegin.c file | annotate | diff | revisions
crtend.c file | annotate | diff | revisions
     1.1 --- a/crtbegin.c	Sat Oct 17 19:42:16 2009 +0200
     1.2 +++ b/crtbegin.c	Sat Oct 17 19:47:23 2009 +0200
     1.3 @@ -30,7 +30,6 @@
     1.4  /*
     1.5   * Run-time module which handles constructors and destructors.
     1.6   */
     1.7 -#include <sys/cdefs.h>
     1.8  #include <stddef.h> /* NULL */
     1.9  
    1.10  typedef void (*ctor_t)(void);
    1.11 @@ -45,9 +44,9 @@
    1.12   */
    1.13  
    1.14  static ctor_t __CTOR_LIST__[1]
    1.15 -    __used __aligned(sizeof(ctor_t)) __section(".ctors") = { (ctor_t)-1 };
    1.16 +    __attribute__((__used__, __aligned__(sizeof(ctor_t)), __section__(".ctors"))) = { (ctor_t)-1 };
    1.17  static dtor_t __DTOR_LIST__[1]
    1.18 -    __used __aligned(sizeof(dtor_t)) __section(".dtors") = { (dtor_t)-1 };
    1.19 +    __attribute__((__used__, __aligned__(sizeof(dtor_t)), __section__(".dtors"))) = { (dtor_t)-1 };
    1.20  
    1.21  
    1.22  #if defined(DWARF2_EH)
    1.23 @@ -56,7 +55,7 @@
    1.24  };
    1.25  
    1.26  static const char __EH_FRAME_BEGIN__[]
    1.27 -    __used __aligned(4) __section(".eh_frame") = { };
    1.28 +    __attribute__((__used__, __aligned__(4), __section__(".eh_frame"))) = { };
    1.29  
    1.30  extern void __register_frame_info(const void *, struct dwarf2_eh_object *)
    1.31      __attribute__((__weak__));
    1.32 @@ -71,7 +70,7 @@
    1.33   */
    1.34  
    1.35  static void *__JCR_LIST__[]
    1.36 -    __used __aligned(sizeof(void *)) __section(".jcr") = { };
    1.37 +    __attribute__((__used__, __aligned__(sizeof(void *)), __section__(".jcr"))) = { };
    1.38  
    1.39  extern void _Jv_RegisterClasses(void *)
    1.40      __attribute__((__weak__));
    1.41 @@ -108,7 +107,7 @@
    1.42  
    1.43  #if !defined(GENERATE_CALL)
    1.44  #define	GENERATE_CALL(section, function)	\
    1.45 -static void __used				\
    1.46 +static void __attribute__((__used__))		\
    1.47  __do_ ## function(void)				\
    1.48  {						\
    1.49  	__asm(".section " section);		\
    1.50 @@ -118,7 +117,7 @@
    1.51  #endif /* !GENERATE_CALL */
    1.52  
    1.53  
    1.54 -static void __noinline __used
    1.55 +static void __attribute__((__noinline__, __used__))
    1.56  __ctors(void)
    1.57  {
    1.58  	unsigned long i = (unsigned long) __CTOR_LIST__[0];
    1.59 @@ -134,7 +133,7 @@
    1.60  		(**p--)();
    1.61  }
    1.62  
    1.63 -static void __noinline __used
    1.64 +static void __attribute__((__noinline__, __used__))
    1.65  __global_ctor_exec(void)
    1.66  {
    1.67  	static int initialized;
    1.68 @@ -163,7 +162,7 @@
    1.69  GENERATE_CALL(".init", __global_ctor_exec)
    1.70  
    1.71  
    1.72 -static void __noinline __used
    1.73 +static void __attribute__((__noinline__, __used__))
    1.74  __dtors(void)
    1.75  {
    1.76  	dtor_t *p = __DTOR_LIST__ + 1;
    1.77 @@ -172,7 +171,7 @@
    1.78  		(**p++)();
    1.79  }
    1.80  
    1.81 -static void __noinline __used
    1.82 +static void __attribute__((__noinline__, __used__))
    1.83  __global_dtor_exec(void)
    1.84  {
    1.85  	static int finished;
     2.1 --- a/crtend.c	Sat Oct 17 19:42:16 2009 +0200
     2.2 +++ b/crtend.c	Sat Oct 17 19:47:23 2009 +0200
     2.3 @@ -1,4 +1,3 @@
     2.4 -#include <sys/cdefs.h>
     2.5  #include <stddef.h> /* NULL */
     2.6  
     2.7  
     2.8 @@ -7,18 +6,18 @@
     2.9  
    2.10  
    2.11  static ctor_t __CTOR_LIST__[1]
    2.12 -    __used __aligned(sizeof(ctor_t)) __section(".ctors") = { 0 };
    2.13 +    __attribute__((__used__, __aligned__(sizeof(ctor_t)), __section__(".ctors"))) = { 0 };
    2.14  static dtor_t __DTOR_LIST__[1]
    2.15 -    __used __aligned(sizeof(dtor_t)) __section(".dtors") = { 0 };
    2.16 +    __attribute__((__used__, __aligned__(sizeof(dtor_t)), __section__(".dtors"))) = { 0 };
    2.17  
    2.18  
    2.19  #ifdef DWARF2_EH
    2.20  static unsigned int __FRAME_END__[]
    2.21 -    __used __aligned(4) __section(".eh_frame") = { 0 };
    2.22 +    __attribute__((__used__, __aligned__(4), __section__(".eh_frame"))) = { 0 };
    2.23  #endif /* DWARF2_EH */
    2.24  
    2.25  
    2.26  #if defined(JCR)
    2.27  static void *__JCR_END__[1]
    2.28 -    __used __aligned(sizeof(void *)) __section(".jcr") = { NULL };
    2.29 +    __attribute__((__used__, __aligned__(sizeof(void *)), __section__(".jcr"))) = { NULL };
    2.30  #endif /* JCR */

mercurial