From 07ce6faff389dcaedc9b11ee4245d2a310f7612b Mon Sep 17 00:00:00 2001 From: Steve Markgraf Date: Sun, 29 Dec 2013 20:33:26 +0100 Subject: 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 --- src/target/firmware/board/compal/highram.lds | 1 + src/target/firmware/board/compal/ram.lds | 1 + src/target/firmware/board/compal_e88/flash.lds | 1 + src/target/firmware/board/compal_e88/loader.lds | 1 + src/target/firmware/board/mediatek/ram.lds | 1 + 5 files changed, 5 insertions(+) diff --git a/src/target/firmware/board/compal/highram.lds b/src/target/firmware/board/compal/highram.lds index 1f0a5a67..a6129fe4 100644 --- a/src/target/firmware/board/compal/highram.lds +++ b/src/target/firmware/board/compal/highram.lds @@ -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 diff --git a/src/target/firmware/board/compal/ram.lds b/src/target/firmware/board/compal/ram.lds index 342870dc..fe75418d 100644 --- a/src/target/firmware/board/compal/ram.lds +++ b/src/target/firmware/board/compal/ram.lds @@ -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 diff --git a/src/target/firmware/board/compal_e88/flash.lds b/src/target/firmware/board/compal_e88/flash.lds index cf0f6a41..67d727ff 100644 --- a/src/target/firmware/board/compal_e88/flash.lds +++ b/src/target/firmware/board/compal_e88/flash.lds @@ -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 diff --git a/src/target/firmware/board/compal_e88/loader.lds b/src/target/firmware/board/compal_e88/loader.lds index a7a001fc..22febff4 100644 --- a/src/target/firmware/board/compal_e88/loader.lds +++ b/src/target/firmware/board/compal_e88/loader.lds @@ -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 diff --git a/src/target/firmware/board/mediatek/ram.lds b/src/target/firmware/board/mediatek/ram.lds index a2af5609..7083c273 100644 --- a/src/target/firmware/board/mediatek/ram.lds +++ b/src/target/firmware/board/mediatek/ram.lds @@ -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 -- cgit v1.2.3