aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-07-07 17:28:53 +0000
committerNick Clifton <nickc@redhat.com>2004-07-07 17:28:53 +0000
commit1fe1f39c06f2d04c2058b902feeafe46fd1ff48b (patch)
tree7b86a452584e85765f7fb2facedad588636e177b /ld
parent5c02dc5924528fb856e17cb5c7e8ea30a1f7111d (diff)
downloadgdb-1fe1f39c06f2d04c2058b902feeafe46fd1ff48b.zip
gdb-1fe1f39c06f2d04c2058b902feeafe46fd1ff48b.tar.gz
gdb-1fe1f39c06f2d04c2058b902feeafe46fd1ff48b.tar.bz2
Add new port: crx-elf
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog11
-rw-r--r--ld/Makefile.am5
-rw-r--r--ld/Makefile.in5
-rw-r--r--ld/NEWS4
-rw-r--r--ld/configure.tgt1
-rw-r--r--ld/emulparams/elf32crx.sh6
-rw-r--r--ld/emultempl/crxelf.em50
-rw-r--r--ld/scripttempl/elf32crx.sc56
8 files changed, 138 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 535d8f5..da8ea08 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,14 @@
+2004-07-06 Tomer Levi <Tomer.Levi@nsc.com>
+
+ * Makefile.am (ALL_EMULATIONS): Add eelf32crx.o.
+ (eelf32crx.c): New target.
+ * Makefile.in: Regenerate.
+ * configure.tgt: Handle crx-*-elf*.
+ * emulparams/elf32crx.sh: New file.
+ * emultempl/crxelf.em: New file.
+ * scripttempl/elf32crx.sc: New file.
+ * NEWS: Mention new target.
+
2004-07-06 Nick Clifton <nickc@redhat.com>
* Makefile.am: Add eshlsymbian.c.
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 74d890a..989203c 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -153,6 +153,7 @@ ALL_EMULATIONS = \
eelf32bmip.o \
eelf32bmipn32.o \
eelf32btsmip.o \
+ eelf32crx.o \
eelf32btsmipn32.o \
eelf32ltsmip.o \
eelf32ltsmipn32.o \
@@ -647,6 +648,10 @@ eelf32btsmip.c: $(srcdir)/emulparams/elf32btsmip.sh \
$(srcdir)/emulparams/elf32bmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32btsmip "$(tdir_elf32btsmip)"
+eelf32crx.c: $(srcdir)/emulparams/elf32crx.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/crxelf.em \
+ $(srcdir)/scripttempl/elf32crx.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32crx "$(tdir_elf32crx)"
eelf32btsmipn32.c: $(srcdir)/emulparams/elf32btsmipn32.sh \
$(srcdir)/emulparams/elf32bmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 4fa3ca5..4b0bf62 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -267,6 +267,7 @@ ALL_EMULATIONS = \
eelf32bmip.o \
eelf32bmipn32.o \
eelf32btsmip.o \
+ eelf32crx.o \
eelf32btsmipn32.o \
eelf32ltsmip.o \
eelf32ltsmipn32.o \
@@ -1373,6 +1374,10 @@ eelf32btsmip.c: $(srcdir)/emulparams/elf32btsmip.sh \
$(srcdir)/emulparams/elf32bmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32btsmip "$(tdir_elf32btsmip)"
+eelf32crx.c: $(srcdir)/emulparams/elf32crx.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/crxelf.em \
+ $(srcdir)/scripttempl/elf32crx.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32crx "$(tdir_elf32crx)"
eelf32btsmipn32.c: $(srcdir)/emulparams/elf32btsmipn32.sh \
$(srcdir)/emulparams/elf32bmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
diff --git a/ld/NEWS b/ld/NEWS
index 1d07084..dc5427b 100644
--- a/ld/NEWS
+++ b/ld/NEWS
@@ -1,5 +1,9 @@
-*- text -*-
+* Support for the crx-elf target added.
+
+* Support for the sh-symbian-elf target added.
+
* A new linker command line switch has been added which allows the hash table
size to be set to a suitable prime value near to its argument. This switch
is --hash-size=<NUMBER>. Also if the switch --reduce-memory-overheads is
diff --git a/ld/configure.tgt b/ld/configure.tgt
index e297707..cade374 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -34,6 +34,7 @@ cris-*-linux-gnu*) targ_emul=crislinux ;;
cris-*-*) targ_emul=criself
targ_extra_emuls="crisaout crislinux"
targ_extra_libpath=$targ_extra_emuls ;;
+crx-*-elf*) targ_emul=elf32crx ;;
d10v-*-*) targ_emul=d10velf ;;
d30v-*-*ext*) targ_emul=d30v_e; targ_extra_emuls="d30velf d30v_o" ;;
d30v-*-*onchip*) targ_emul=d30v_o; targ_extra_emuls="d30velf d30v_e" ;;
diff --git a/ld/emulparams/elf32crx.sh b/ld/emulparams/elf32crx.sh
new file mode 100644
index 0000000..24960ec
--- /dev/null
+++ b/ld/emulparams/elf32crx.sh
@@ -0,0 +1,6 @@
+SCRIPT_NAME=elf32crx
+TEMPLATE_NAME=elf32
+OUTPUT_FORMAT="elf32-crx"
+ARCH=crx
+ENTRY=_start
+EXTRA_EM_FILE=crxelf
diff --git a/ld/emultempl/crxelf.em b/ld/emultempl/crxelf.em
new file mode 100644
index 0000000..0694bb9
--- /dev/null
+++ b/ld/emultempl/crxelf.em
@@ -0,0 +1,50 @@
+# This shell script emits a C file. -*- C -*-
+# Copyright 2004
+# Free Software Foundation, Inc.
+#
+# This file is part of GLD, the Gnu Linker.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+# This file is sourced from elf32.em, and defines extra crx-elf
+# specific routines.
+#
+cat >>e${EMULATION_NAME}.c <<EOF
+
+#include "ldctor.h"
+
+static void crxelf_after_parse (void);
+
+static void
+crxelf_after_parse (void)
+{
+ /* Always behave as if called with --sort-common command line
+ option.
+ This is to emulate the CRTools' method of keeping variables
+ of different alignment in separate sections. */
+ config.sort_common = TRUE;
+
+ /* Don't create a demand-paged executable, since this feature isn't
+ meaninful in CR16C embedded systems. Moreover, when magic_demand_paged
+ is true the link sometimes fails. */
+ config.magic_demand_paged = FALSE;
+}
+
+EOF
+
+# Put these extra crx-elf routines in ld_${EMULATION_NAME}_emulation
+#
+LDEMUL_AFTER_PARSE=crxelf_after_parse
diff --git a/ld/scripttempl/elf32crx.sc b/ld/scripttempl/elf32crx.sc
new file mode 100644
index 0000000..544fc3e
--- /dev/null
+++ b/ld/scripttempl/elf32crx.sc
@@ -0,0 +1,56 @@
+# Linker Script for National Semiconductor's CRX-ELF32.
+
+# The next line should be uncommented if it is desired to link
+# without libstart.o and directly enter main.
+
+# ENTRY=_main
+
+test -z "$ENTRY" && ENTRY=_start
+cat <<EOF
+
+/* Example Linker Script for linking NS CRX elf32 files. */
+
+/* The next line forces the entry point (${ENTRY} in this script)
+ to be entered in the output file as an undefined symbol.
+ It is needed in case the entry point is not called explicitly
+ (which is the usual case) AND is in an archive. */
+
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+EXTERN(${ENTRY})
+ENTRY(${ENTRY})
+
+/* Define memory regions. */
+MEMORY
+{
+ rom : ORIGIN = 0x2, LENGTH = 3M
+ ram : ORIGIN = 4M, LENGTH = 10M
+}
+
+SECTIONS
+{
+ .text : { __TEXT_START = .; *(.text) *(.text.*) *(.gnu.linkonce.t.*) __TEXT_END = .; } > rom
+
+ .rdata : { __RDATA_START = .; *(.rdata_4) *(.rdata_2) *(.rdata_1) *(.rdata.*) *(.gnu.linkonce.r.*) __RDATA_END = .; } > rom
+
+ .ctor ALIGN(4) : { __CTOR_LIST = .; *(.ctors) __CTOR_END = .; } > rom
+
+ .dtor ALIGN(4) : { __DTOR_LIST = .; *(.dtors) __DTOR_END = .; } > rom
+
+ .data : { __DATA_START = .; *(.data_4) *(.data_2) *(.data_1) *(.data) *(.data.*) *(.gnu.linkonce.d.*) __DATA_END = .; } > ram AT > rom
+
+ .bss (NOLOAD) : { __BSS_START = .; *(.bss_4) *(.bss_2) *(.bss_1) *(.bss) *(COMMON) *(.bss.*) *(.gnu.linkonce.b.*) __BSS_END = .; } > ram
+
+/* You may change the sizes of the following sections to fit the actual
+ size your program requires.
+
+ The heap and stack are aligned to the bus width, as a speed optimization
+ for accessing data located there. */
+
+ .heap : { . = ALIGN(4); __HEAP_START = .; . += 0x2000; __HEAP_MAX = .; } > ram
+ .stack : { . = ALIGN(4); . += 0x6000; __STACK_START = .; } > ram
+ .istack : { . = ALIGN(4); . += 0x100; __ISTACK_START = .; } > ram
+}
+
+__DATA_IMAGE_START = LOADADDR(.data);
+EOF