summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-04-22 13:07:56 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-04-22 15:12:11 -0500
commit851e64321b3b704f106556d5d34eb6e2d31fe504 (patch)
treef9762bbd128bc3fc592db91f21e2670171733e85
parent3191b426817454f35b2e95bb9e91530c5f0545a4 (diff)
downloadrtems-851e64321b3b704f106556d5d34eb6e2d31fe504.tar.bz2
gensh2: Correct linking for C++
-rw-r--r--c/src/lib/libbsp/sh/gensh2/bsp_specs6
-rw-r--r--c/src/lib/libbsp/sh/gensh2/startup/linkcmds18
2 files changed, 8 insertions, 16 deletions
diff --git a/c/src/lib/libbsp/sh/gensh2/bsp_specs b/c/src/lib/libbsp/sh/gensh2/bsp_specs
index 34d002b88f..975c0b2b51 100644
--- a/c/src/lib/libbsp/sh/gensh2/bsp_specs
+++ b/c/src/lib/libbsp/sh/gensh2/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/gensh2/startup/linkcmds b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds
index ab7e31e5d0..e9f73f9397 100644
--- a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds
+++ b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds
@@ -115,7 +115,6 @@ SECTIONS
.rel.fini : { *(.rel.fini) }
.rel.bss : { *(.rel.bss) }
.rel.plt : { *(.rel.plt) }
- .init : { *(.init) } =0
.plt : { *(.plt) }
.text . :
{
@@ -139,7 +138,10 @@ SECTIONS
} > ram
_etext = .;
PROVIDE (etext = .);
- .fini . : { *(.fini) } > ram =0
+ .init . : { KEEP(*(.init)) } > ram =0
+ .fini . : { KEEP(*(.fini)) } > ram =0
+ .ctors . : { KEEP(*(.ctors)) } > ram =0
+ .dtors . : { KEEP(*(.dtors)) } > ram =0
.rodata . : { *(.rodata*) *(.gnu.linkonce.r*) } > ram
.rodata1 . : { *(.rodata1) } > ram
.tdata : {
@@ -174,18 +176,6 @@ SECTIONS
CONSTRUCTORS
} > ram
.data1 . : { *(.data1) }
- .ctors . :
- {
- ___ctors = .;
- *(.ctors)
- ___ctors_end = .;
- }
- .dtors . :
- {
- ___dtors = .;
- *(.dtors)
- ___dtors_end = .;
- }
.got . : { *(.got.plt) *(.got) }
.dynamic . : { *(.dynamic) }
/* We want the small data sections together, so single-instruction offsets