diff packages/hal/synth/arch/current/src/synth.ld @ 3370:68c8985fd5f0

* src/synth.ld src/synth_entry.c: Look for static constructors in the .init_array section as well as .ctors (needed for gcc 4.7 and later)
author jlarmour
date Fri, 03 Oct 2014 15:13:21 +0000
parents c23173de14a8
children
line wrap: on
line diff
--- a/packages/hal/synth/arch/current/src/synth.ld
+++ b/packages/hal/synth/arch/current/src/synth.ld
@@ -197,6 +197,9 @@ GROUP(libtarget.a libgcc.a)
       KEEP(*(SORT(.ctors*))) __CTOR_END__ = ABSOLUTE(.);                        \
      __DTOR_LIST__ = ABSOLUTE(.);                                            	\
        KEEP(*(SORT(.dtors*))) __DTOR_END__ = ABSOLUTE(.);                    	\
+      /* In gcc 4.7, constructors moved from .ctors to .init_array . */         \
+     . = ALIGN(8); __init_array_start__ = ABSOLUTE(.);                          \
+      KEEP(*(SORT(.init_array*))) __init_array_end__ = ABSOLUTE(.);             \
     . = ALIGN(32);                                                              \
     KEEP(*( SORT (.ecos.table.*)));                                             \
     _GOT2_START_ = ABSOLUTE(.); *(.got2) _GOT2_END_ = ABSOLUTE(.);              \