summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGedare Bloom <gedare@rtems.org>2021-07-01 12:32:57 -0600
committerGedare Bloom <gedare@rtems.org>2021-07-01 12:53:50 -0600
commite5a1b15848e9a3da557651ce4194abf43155d295 (patch)
treeab707f55baa117253c7aeff9ac53ae553fd77d35
parentbsps/i386: Update calibration of TSC to be more accurate (diff)
downloadrtems-e5a1b15848e9a3da557651ce4194abf43155d295.tar.bz2
m68k/uC5282: linkcmds KEEP and SORT sections
Fixes a problem with bad epilog code in _fini and to keep sections necessary with the -ffunction/data-sections. Closes #4465.
-rw-r--r--bsps/m68k/uC5282/start/linkcmds34
1 files changed, 19 insertions, 15 deletions
diff --git a/bsps/m68k/uC5282/start/linkcmds b/bsps/m68k/uC5282/start/linkcmds
index da97472f1b..af9a69b802 100644
--- a/bsps/m68k/uC5282/start/linkcmds
+++ b/bsps/m68k/uC5282/start/linkcmds
@@ -91,13 +91,13 @@ SECTIONS
* crtn.o are in.
*/
PROVIDE (_init = .);
- *crti.o(.init)
- *(.init)
- *crtn.o(.init)
+ KEEP (*crti.o(.init))
+ KEEP (*(.init))
+ KEEP (*crtn.o(.init))
PROVIDE (_fini = .);
- *crti.o(.fini)
- *(.fini)
- *crtn.o(.fini)
+ KEEP (*crti.o(.fini))
+ KEEP (*(.fini))
+ KEEP (*crtn.o(.fini))
/*
* Special FreeBSD sysctl sections.
@@ -122,18 +122,22 @@ SECTIONS
* crtend.o. The same comments apply to it.
*/
. = ALIGN (16);
- *crtbegin.o(.ctors)
- *(.ctors)
- *crtend.o(.ctors)
- *crtbegin.o(.dtors)
- *(.dtors)
- *crtend.o(.dtors)
+ KEEP (*crtbegin.o(.ctors))
+ KEEP (*crtbegin?.o(.ctors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*crtbegin?.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
/*
* Exception frame info
*/
. = ALIGN (16);
- *(.eh_frame)
+ KEEP (*(.eh_frame))
/*
* Read-only data
@@ -141,7 +145,7 @@ SECTIONS
. = ALIGN (16);
_rodata_start = . ;
*(.rodata*)
- KEEP (*(SORT(.rtemsroset.*)))
+ KEEP (*(SORT(.rtemsroset.*)))
*(.gnu.linkonce.r*)
. = ALIGN (16);
@@ -179,7 +183,7 @@ SECTIONS
KEEP (*(SORT(.rtemsrwset.*)))
*(.gnu.linkonce.d*)
*(.gcc_except_table*)
- *(.jcr)
+ KEEP (*(.jcr))
. = ALIGN (16);
PROVIDE (_edata = .);
PROVIDE (_copy_end = .);