summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-04-22 13:07:44 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-04-22 15:12:11 -0500
commit3191b426817454f35b2e95bb9e91530c5f0545a4 (patch)
tree88217c97108b31ff79243e6a4b238cfb3cad5307
parentscore603e: Add rtems_crti (diff)
downloadrtems-3191b426817454f35b2e95bb9e91530c5f0545a4.tar.bz2
gensh1: Correct linking for C++
-rw-r--r--c/src/lib/libbsp/sh/gensh1/bsp_specs6
-rw-r--r--c/src/lib/libbsp/sh/gensh1/startup/linkcmds18
2 files changed, 8 insertions, 16 deletions
diff --git a/c/src/lib/libbsp/sh/gensh1/bsp_specs b/c/src/lib/libbsp/sh/gensh1/bsp_specs
index 34d002b88f..975c0b2b51 100644
--- a/c/src/lib/libbsp/sh/gensh1/bsp_specs
+++ b/c/src/lib/libbsp/sh/gensh1/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/gensh1/startup/linkcmds b/c/src/lib/libbsp/sh/gensh1/startup/linkcmds
index 62e5584a3e..80a241c896 100644
--- a/c/src/lib/libbsp/sh/gensh1/startup/linkcmds
+++ b/c/src/lib/libbsp/sh/gensh1/startup/linkcmds
@@ -102,7 +102,6 @@ SECTIONS
.rel.fini : { *(.rel.fini) }
.rel.bss : { *(.rel.bss) }
.rel.plt : { *(.rel.plt) }
- .init : { *(.init) } =0
.plt : { *(.plt) }
.text . :
{
@@ -128,7 +127,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 : {
@@ -163,18 +165,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