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:
parent
44649961dd
commit
07ce6faff3
|
@ -60,6 +60,7 @@ SECTIONS
|
||||||
LONG(SIZEOF(.ctors) / 4 - 2)
|
LONG(SIZEOF(.ctors) / 4 - 2)
|
||||||
/* ctor pointers */
|
/* ctor pointers */
|
||||||
KEEP(*(SORT(.ctors)))
|
KEEP(*(SORT(.ctors)))
|
||||||
|
KEEP(*(SORT(.init_array)))
|
||||||
/* end of list */
|
/* end of list */
|
||||||
LONG(0)
|
LONG(0)
|
||||||
} > LRAM
|
} > LRAM
|
||||||
|
|
|
@ -62,6 +62,7 @@ SECTIONS
|
||||||
LONG(SIZEOF(.ctors) / 4 - 2)
|
LONG(SIZEOF(.ctors) / 4 - 2)
|
||||||
/* ctor pointers */
|
/* ctor pointers */
|
||||||
KEEP(*(SORT(.ctors)))
|
KEEP(*(SORT(.ctors)))
|
||||||
|
KEEP(*(SORT(.init_array)))
|
||||||
/* end of list */
|
/* end of list */
|
||||||
LONG(0)
|
LONG(0)
|
||||||
} > LRAM
|
} > LRAM
|
||||||
|
|
|
@ -54,6 +54,7 @@ SECTIONS
|
||||||
LONG(SIZEOF(.ctors) / 4 - 2)
|
LONG(SIZEOF(.ctors) / 4 - 2)
|
||||||
/* ctor pointers */
|
/* ctor pointers */
|
||||||
KEEP(*(SORT(.ctors)))
|
KEEP(*(SORT(.ctors)))
|
||||||
|
KEEP(*(SORT(.init_array)))
|
||||||
/* end of list */
|
/* end of list */
|
||||||
LONG(0)
|
LONG(0)
|
||||||
} > FLASH
|
} > FLASH
|
||||||
|
|
|
@ -67,6 +67,7 @@ SECTIONS
|
||||||
LONG(SIZEOF(.ctors) / 4 - 2)
|
LONG(SIZEOF(.ctors) / 4 - 2)
|
||||||
/* ctor pointers */
|
/* ctor pointers */
|
||||||
KEEP(*(SORT(.ctors)))
|
KEEP(*(SORT(.ctors)))
|
||||||
|
KEEP(*(SORT(.init_array)))
|
||||||
/* end of list */
|
/* end of list */
|
||||||
LONG(0)
|
LONG(0)
|
||||||
} > FLASH
|
} > FLASH
|
||||||
|
|
|
@ -51,6 +51,7 @@ SECTIONS
|
||||||
LONG(SIZEOF(.ctors) / 4 - 2)
|
LONG(SIZEOF(.ctors) / 4 - 2)
|
||||||
/* ctor pointers */
|
/* ctor pointers */
|
||||||
KEEP(*(SORT(.ctors)))
|
KEEP(*(SORT(.ctors)))
|
||||||
|
KEEP(*(SORT(.init_array)))
|
||||||
/* end of list */
|
/* end of list */
|
||||||
LONG(0)
|
LONG(0)
|
||||||
} > LRAM
|
} > LRAM
|
||||||
|
|
Loading…
Reference in New Issue