aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog10
-rw-r--r--ld/Makefile.am15
-rw-r--r--ld/Makefile.in15
-rw-r--r--ld/NEWS2
-rw-r--r--ld/configure.tgt3
-rw-r--r--ld/emulparams/scoreelf.sh15
-rw-r--r--ld/emultempl/scoreelf.em21
7 files changed, 62 insertions, 19 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 5f11b8d..de067e4 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,13 @@
+2009-03-02 Qinwei <qinwei@sunnorth.com.cn>
+
+ * Makefile.am: Replace score elf emulation with score3 and score7
+ emulations.
+ * Makefile.in: Regenerate,
+ * NEWS: Mention support for Score7 architecture.
+ * configure.tgt: Add score7 emulation to score-elf target.
+ * emulparams/scoreelf.sh: Add score7 support.
+ * emultempl/scoreelf.em: Likewise.
+
2009-03-01 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* configure.tgt: Only use elf64hppa target emulation for hpux.
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 806168e..0dbc734 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -356,7 +356,8 @@ ALL_EMULATIONS = \
eppcpe.o \
eppclynx.o \
eriscix.o \
- escoreelf.o \
+ escore3_elf.o \
+ escore7_elf.o \
esh.o \
eshelf32.o \
eshlelf32.o \
@@ -1556,10 +1557,14 @@ eppclynx.c: $(srcdir)/emulparams/ppclynx.sh \
eriscix.c: $(srcdir)/emulparams/riscix.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} riscix "$(tdir_riscix)"
-escoreelf.c: $(srcdir)/emulparams/scoreelf.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/scoreelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} scoreelf "$(tdir_scoreelf)"
+escore3_elf.c: $(srcdir)/emulparams/scoreelf.sh \
+ $(ELF_DEPS) $(srcdir)/emultempl/scoreelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} score3_elf "$(tdir_score3_elf)" scoreelf
+escore7_elf.c: $(srcdir)/emulparams/scoreelf.sh \
+ $(ELF_DEPS) $(srcdir)/emultempl/scoreelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} score7_elf "$(tdir_score7_elf)" scoreelf
esh.c: $(srcdir)/emulparams/sh.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
${GENSCRIPTS} sh "$(tdir_sh)"
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 1c38d91..e8b7476 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -620,7 +620,8 @@ ALL_EMULATIONS = \
eppcpe.o \
eppclynx.o \
eriscix.o \
- escoreelf.o \
+ escore3_elf.o \
+ escore7_elf.o \
esh.o \
eshelf32.o \
eshlelf32.o \
@@ -2402,10 +2403,14 @@ eppclynx.c: $(srcdir)/emulparams/ppclynx.sh \
eriscix.c: $(srcdir)/emulparams/riscix.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} riscix "$(tdir_riscix)"
-escoreelf.c: $(srcdir)/emulparams/scoreelf.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/scoreelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} scoreelf "$(tdir_scoreelf)"
+escore3_elf.c: $(srcdir)/emulparams/scoreelf.sh \
+ $(ELF_DEPS) $(srcdir)/emultempl/scoreelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} score3_elf "$(tdir_score3_elf)" scoreelf
+escore7_elf.c: $(srcdir)/emulparams/scoreelf.sh \
+ $(ELF_DEPS) $(srcdir)/emultempl/scoreelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} score7_elf "$(tdir_score7_elf)" scoreelf
esh.c: $(srcdir)/emulparams/sh.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
${GENSCRIPTS} sh "$(tdir_sh)"
diff --git a/ld/NEWS b/ld/NEWS
index 9a79082..1789c8b 100644
--- a/ld/NEWS
+++ b/ld/NEWS
@@ -13,6 +13,8 @@
* Add a new command line option, -Ttext-segment ADDR, for ELF targets
to set the address of the first byte of the text segment.
+* Add support for Sunplus score architecture.
+
* Add new option --use-nul-prefixed-import-tables to ld for PE targets to
allow fallback to old import table generation with null element prefix.
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 674468a..72cef17 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -506,7 +506,8 @@ s390-*-linux*) targ_emul=elf_s390
targ64_extra_libpath=elf64_s390
tdir_elf64_s390=`echo ${targ_alias} | sed -e 's/s390/s390x/'`
;;
-score-*-elf) targ_emul=scoreelf ;;
+score-*-elf) targ_emul=score7_elf
+ targ_extra_emuls=score3_elf ;;
sh-*-linux*) targ_emul=shlelf_linux
targ_extra_emuls=shelf_linux
targ_extra_libpath=shelf_linux ;;
diff --git a/ld/emulparams/scoreelf.sh b/ld/emulparams/scoreelf.sh
index dfb5aca..3a7ed31 100644
--- a/ld/emulparams/scoreelf.sh
+++ b/ld/emulparams/scoreelf.sh
@@ -1,6 +1,7 @@
MACHINE=
SCRIPT_NAME=elf
TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=scoreelf
OUTPUT_FORMAT="elf32-bigscore"
BIG_OUTPUT_FORMAT="elf32-bigscore"
LITTLE_OUTPUT_FORMAT="elf32-littlescore"
@@ -8,10 +9,8 @@ NO_RELA_RELOCS=yes
GROUP="-lm -lc -lglsim -lgcc -lstdc++"
TEXT_START_ADDR=0x00000000
-case ${LD_FLAG} in
- n|N) TEXT_START_ADDR=0x0400000 ;;
-esac
MAXPAGESIZE=256
+NONPAGED_TEXT_START_ADDR=0x0400000
SHLIB_TEXT_START_ADDR=0x5ffe0000
OTHER_GOT_SYMBOLS='
_gp = ALIGN(16) + 0x3ff0;
@@ -27,7 +26,15 @@ OTHER_BSS_SYMBOLS='
# This sets the stack to the top of the simulator memory (2^19 bytes).
STACK_ADDR=0x8000000
-ARCH=score
+SCORE_NAME=${EMULATION_NAME}
+if [ "${SCORE_NAME}" = "score3_elf" ] ; then
+ARCH=score3
+fi
+
+if [ "${SCORE_NAME}" = "score7_elf" ] ; then
+ARCH=score7
+fi
+
MACHINE=
ENTRY=_start
EMBEDDED=yes
diff --git a/ld/emultempl/scoreelf.em b/ld/emultempl/scoreelf.em
index f6cb510..897147e 100644
--- a/ld/emultempl/scoreelf.em
+++ b/ld/emultempl/scoreelf.em
@@ -1,6 +1,7 @@
# This shell script emits a C file. -*- C -*-
-# Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
+# Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# Contributed by:
+# Brain.lin (brain.lin@sunplusct.com)
# Mei Ligang (ligang@sunnorth.com.cn)
# Pei-Lin Tsai (pltsai@sunplus.com)
@@ -27,14 +28,16 @@
#
fragment <<EOF
+#include "elf32-score.h"
+
static void
gld${EMULATION_NAME}_before_parse ()
{
#ifndef TARGET_ /* I.e., if not generic. */
- ldfile_set_output_arch ("`echo ${ARCH}`");
+ ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
#endif /* not TARGET_ */
- config.dynamic_link = ${DYNAMIC_LINK-true};
- config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`;
+ config.dynamic_link = ${DYNAMIC_LINK-TRUE};
+ config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
}
static void
@@ -56,9 +59,19 @@ score_elf_after_open (void)
EOF
+# Define some shell vars to insert bits of code into the standard elf
+# parse_args and list_options functions.
+#
+PARSE_AND_LIST_PROLOGUE=''
+PARSE_AND_LIST_SHORTOPTS=
+PARSE_AND_LIST_LONGOPTS=''
+PARSE_AND_LIST_OPTIONS=''
+PARSE_AND_LIST_ARGS_CASES=''
+
# We have our own after_open and before_allocation functions, but they call
# the standard routines, so give them a different name.
LDEMUL_AFTER_OPEN=score_elf_after_open
# Replace the elf before_parse function with our own.
LDEMUL_BEFORE_PARSE=gld"${EMULATION_NAME}"_before_parse
+