summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-04-22 13:10:47 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-04-22 15:12:11 -0500
commit1450de0d7eeab51a525d6e7f2ce8d005b0428e74 (patch)
treed81de9ad6d789f75b1f49e25141bfcd94543e7cd
parent25c3208aef2de6df5de36ac62af22ded80d7690e (diff)
downloadrtems-1450de0d7eeab51a525d6e7f2ce8d005b0428e74.tar.bz2
shsim: Correct linking for C++
-rw-r--r--c/src/lib/libbsp/sh/shsim/bsp_specs6
-rw-r--r--c/src/lib/libbsp/sh/shsim/startup/linkcmds23
2 files changed, 13 insertions, 16 deletions
diff --git a/c/src/lib/libbsp/sh/shsim/bsp_specs b/c/src/lib/libbsp/sh/shsim/bsp_specs
index 34d002b88f..975c0b2b51 100644
--- a/c/src/lib/libbsp/sh/shsim/bsp_specs
+++ b/c/src/lib/libbsp/sh/shsim/bsp_specs
@@ -4,8 +4,10 @@
*startfile:
%{!qrtems: %(old_startfile)} \
-%{!nostdlib: %{qrtems: start.o%s -e _start}}
+%{!nostdlib: %{qrtems: start.o%s crti.o%s crtbegin.o%s -e _start}}
*link:
-%(old_link) %{qrtems: -dc -dp -N}
+%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N}
+*endfile:
+%{!qrtems: %(old_endfile)} %{qrtems: crtend.o%s crtn.o%s}
diff --git a/c/src/lib/libbsp/sh/shsim/startup/linkcmds b/c/src/lib/libbsp/sh/shsim/startup/linkcmds
index addeac408e..3f7ea0e5be 100644
--- a/c/src/lib/libbsp/sh/shsim/startup/linkcmds
+++ b/c/src/lib/libbsp/sh/shsim/startup/linkcmds
@@ -99,7 +99,6 @@ SECTIONS
.rel.fini : { *(.rel.fini) }
.rel.bss : { *(.rel.bss) }
.rel.plt : { *(.rel.plt) }
- .init : { *(.init) } =0
.plt : { *(.plt) }
.text . :
{
@@ -121,10 +120,14 @@ SECTIONS
*(.gnu.warning)
*(.gnu.linkonce.t*)
} > ram
+ .init :
+ {
+ KEEP (*(.init))
+ } >ram
.fini :
{
KEEP (*(.fini))
- } =0
+ } >ram
_etext = .;
PROVIDE (etext = .);
.rodata . : { *(.rodata*) .rodata.* *(.gnu.linkonce.r*) } > ram
@@ -139,6 +142,10 @@ SECTIONS
*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
__TLS_BSS_end = .;
} > ram
+ .init . : { KEEP(*(.init)) } > ram =0
+ .fini . : { KEEP(*(.fini)) } > ram =0
+ .ctors . : { KEEP(*(.ctors)) } > ram =0
+ .dtors . : { KEEP(*(.dtors)) } > ram =0
__TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
__TLS_Data_begin = __TLS_Data_size != 0 ? __TLS_Data_begin : __TLS_BSS_begin;
__TLS_Data_end = __TLS_Data_size != 0 ? __TLS_Data_end : __TLS_BSS_begin;
@@ -161,18 +168,6 @@ SECTIONS
CONSTRUCTORS
} > ram
.data1 . : { *(.data1) }
- .ctors . :
- {
- ___ctors = .;
- *(.ctors)
- ___ctors_end = .;
- }
- .dtors . :
- {
- ___dtors = .;
- *(.dtors)
- ___dtors_end = .;
- }
.rtemsroset : {
/* for pre rtems-libbsd FreeBSD code */
__start_set_sysctl_set = .;