summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/board/common
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-06-24 17:52:05 +0200
committerHarald Welte <laforge@gnumonks.org>2010-06-24 17:52:05 +0200
commit93db95712e8f70a60b2e78dc53978bb51eccbafe (patch)
treee1aea0f4ceb3fce2bb1e9faa7d231c340828ce2b /src/target/firmware/board/common
parent8c1f25e6276058b4ae96b37138b2ad1f91c1bb7e (diff)
[firmware] make sure the .ctor sections are preserved during --gc-sections
--gc-sections throws away any symbol that is not referenced from either the entry symbol or explicit KEEP statements in the linker script. We add KEEP() to make sure the constructors are kept.
Diffstat (limited to 'src/target/firmware/board/common')
-rw-r--r--src/target/firmware/board/common/compal_osmoload.lds4
-rw-r--r--src/target/firmware/board/common/compal_ramload.lds4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/target/firmware/board/common/compal_osmoload.lds b/src/target/firmware/board/common/compal_osmoload.lds
index 6f6a9679..2765ec22 100644
--- a/src/target/firmware/board/common/compal_osmoload.lds
+++ b/src/target/firmware/board/common/compal_osmoload.lds
@@ -32,12 +32,12 @@ SECTIONS
. = ALIGN(4);
__CTOR_LIST__ = .;
LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(SORT(.ctors))
+ KEEP(*(SORT(.ctors)))
LONG(0) /* end of list */
__CTOR_END__ = .;
__DTOR_LIST__ = .;
LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(SORT(.dtors))
+ KEEP(*(SORT(.dtors)))
LONG(0) /* end of list */
__DTOR_END__ = .;
} > LRAM
diff --git a/src/target/firmware/board/common/compal_ramload.lds b/src/target/firmware/board/common/compal_ramload.lds
index 1ea782ed..00f0d001 100644
--- a/src/target/firmware/board/common/compal_ramload.lds
+++ b/src/target/firmware/board/common/compal_ramload.lds
@@ -48,12 +48,12 @@ SECTIONS
. = ALIGN(4);
__CTOR_LIST__ = .;
LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(SORT(.ctors))
+ KEEP(*(SORT(.ctors)))
LONG(0) /* end of list */
__CTOR_END__ = .;
__DTOR_LIST__ = .;
LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(SORT(.dtors))
+ KEEP(*(SORT(.dtors)))
LONG(0) /* end of list */
__DTOR_END__ = .;
} > LRAM