fw: tell linker to add init_array to ctor section

Starting with version 4.8, gcc places functions
with __attribute__ ((constructor)) in .init_array
instead of .ctors by default.

This broke firmware images built with gcc >= 4.8.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
Steve Markgraf 2013-12-29 20:33:26 +01:00 committed by Sylvain Munaut
parent 44649961dd
commit 07ce6faff3
5 changed files with 5 additions and 0 deletions

View File

@ -60,6 +60,7 @@ SECTIONS
LONG(SIZEOF(.ctors) / 4 - 2)
/* ctor pointers */
KEEP(*(SORT(.ctors)))
KEEP(*(SORT(.init_array)))
/* end of list */
LONG(0)
} > LRAM

View File

@ -62,6 +62,7 @@ SECTIONS
LONG(SIZEOF(.ctors) / 4 - 2)
/* ctor pointers */
KEEP(*(SORT(.ctors)))
KEEP(*(SORT(.init_array)))
/* end of list */
LONG(0)
} > LRAM

View File

@ -54,6 +54,7 @@ SECTIONS
LONG(SIZEOF(.ctors) / 4 - 2)
/* ctor pointers */
KEEP(*(SORT(.ctors)))
KEEP(*(SORT(.init_array)))
/* end of list */
LONG(0)
} > FLASH

View File

@ -67,6 +67,7 @@ SECTIONS
LONG(SIZEOF(.ctors) / 4 - 2)
/* ctor pointers */
KEEP(*(SORT(.ctors)))
KEEP(*(SORT(.init_array)))
/* end of list */
LONG(0)
} > FLASH

View File

@ -51,6 +51,7 @@ SECTIONS
LONG(SIZEOF(.ctors) / 4 - 2)
/* ctor pointers */
KEEP(*(SORT(.ctors)))
KEEP(*(SORT(.init_array)))
/* end of list */
LONG(0)
} > LRAM