From 5efb71755dfad00d5c2219d45f35fa73d45b8850 Mon Sep 17 00:00:00 2001 From: msaitoh Date: Sun, 26 Dec 1999 19:59:22 +0000 Subject: [PATCH] ld.new for NetBSD/sh3 --- gnu/dist/ld/Makefile.am | 12 ++++++ gnu/dist/ld/Makefile.in | 12 ++++++ gnu/dist/ld/emulparams/elf32shlunx.sh | 15 ++++++++ gnu/dist/ld/emulparams/elf32shunx.sh | 15 ++++++++ gnu/dist/ld/emulparams/shlunx.sh | 5 +++ gnu/dist/ld/emulparams/shunx.sh | 5 +++ gnu/dist/ld/scripttempl/shunx.sc | 53 +++++++++++++++++++++++++++ gnu/usr.bin/ld.new/Makefile | 14 ++++++- 8 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 gnu/dist/ld/emulparams/elf32shlunx.sh create mode 100644 gnu/dist/ld/emulparams/elf32shunx.sh create mode 100644 gnu/dist/ld/emulparams/shlunx.sh create mode 100644 gnu/dist/ld/emulparams/shunx.sh create mode 100644 gnu/dist/ld/scripttempl/shunx.sc diff --git a/gnu/dist/ld/Makefile.am b/gnu/dist/ld/Makefile.am index eaecd49c63ab..be5666d9bbca 100644 --- a/gnu/dist/ld/Makefile.am +++ b/gnu/dist/ld/Makefile.am @@ -488,6 +488,18 @@ eshlelf.c: $(srcdir)/emulparams/shlelf.sh \ eshl.c: $(srcdir)/emulparams/shl.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS} ${GENSCRIPTS} shl "$(tdir_shl)" +eshunx.c: $(srcdir)/emulparams/shunx.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS} + ${GENSCRIPTS} shunx "$(tdir_shunx)" +eshlunx.c: $(srcdir)/emulparams/shlunx.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/shunx.sc ${GEN_DEPENDS} + ${GENSCRIPTS} shlunx "$(tdir_shlunx)" +eelf32shunx.c: $(srcdir)/emulparams/elf32shunx.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf32shunx "$(tdir_elf32shunx)" +eelf32shlunx.c: $(srcdir)/emulparams/elf32shlunx.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf32shlunx "$(tdir_elf32shlunx)" esparcaout.c: $(srcdir)/emulparams/sparcaout.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} sparcaout "$(tdir_sparcaout)" diff --git a/gnu/dist/ld/Makefile.in b/gnu/dist/ld/Makefile.in index 1f6b72db3046..68e0ad4df171 100644 --- a/gnu/dist/ld/Makefile.in +++ b/gnu/dist/ld/Makefile.in @@ -998,6 +998,18 @@ eshlelf.c: $(srcdir)/emulparams/shlelf.sh \ eshl.c: $(srcdir)/emulparams/shl.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS} ${GENSCRIPTS} shl "$(tdir_shl)" +eshunx.c: $(srcdir)/emulparams/shunx.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS} + ${GENSCRIPTS} shunx "$(tdir_shunx)" +eshlunx.c: $(srcdir)/emulparams/shlunx.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/shunx.sc ${GEN_DEPENDS} + ${GENSCRIPTS} shlunx "$(tdir_shlunx)" +eelf32shunx.c: $(srcdir)/emulparams/elf32shunx.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf32shunx "$(tdir_elf32shunx)" +eelf32shlunx.c: $(srcdir)/emulparams/elf32shlunx.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf32shlunx "$(tdir_elf32shlunx)" esparcaout.c: $(srcdir)/emulparams/sparcaout.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} ${GENSCRIPTS} sparcaout "$(tdir_sparcaout)" diff --git a/gnu/dist/ld/emulparams/elf32shlunx.sh b/gnu/dist/ld/emulparams/elf32shlunx.sh new file mode 100644 index 000000000000..611fa1b5bae3 --- /dev/null +++ b/gnu/dist/ld/emulparams/elf32shlunx.sh @@ -0,0 +1,15 @@ +SCRIPT_NAME=elf +OUTPUT_FORMAT="elf32-shl-unx" +TEXT_START_ADDR=0x1000 +MAXPAGESIZE=0x1000 +ARCH=sh +MACHINE= +TEMPLATE_NAME=elf32 +GENERATE_SHLIB_SCRIPT=yes + +# These are for compatibility with the COFF toolchain. +ENTRY=start +CTOR_START='___ctors = .;' +CTOR_END='___ctors_end = .;' +DTOR_START='___dtors = .;' +DTOR_END='___dtors_end = .;' diff --git a/gnu/dist/ld/emulparams/elf32shunx.sh b/gnu/dist/ld/emulparams/elf32shunx.sh new file mode 100644 index 000000000000..7ac622326b92 --- /dev/null +++ b/gnu/dist/ld/emulparams/elf32shunx.sh @@ -0,0 +1,15 @@ +SCRIPT_NAME=elf +OUTPUT_FORMAT="elf32-sh-unx" +TEXT_START_ADDR=0x1000 +MAXPAGESIZE=0x1000 +ARCH=sh +MACHINE= +TEMPLATE_NAME=elf32 +GENERATE_SHLIB_SCRIPT=yes + +# These are for compatibility with the COFF toolchain. +ENTRY=start +CTOR_START='___ctors = .;' +CTOR_END='___ctors_end = .;' +DTOR_START='___dtors = .;' +DTOR_END='___dtors_end = .;' diff --git a/gnu/dist/ld/emulparams/shlunx.sh b/gnu/dist/ld/emulparams/shlunx.sh new file mode 100644 index 000000000000..e6a48edbc1c2 --- /dev/null +++ b/gnu/dist/ld/emulparams/shlunx.sh @@ -0,0 +1,5 @@ +SCRIPT_NAME=shunx +OUTPUT_FORMAT="coff-shl" +TEXT_START_ADDR=0x1000 +TARGET_PAGE_SIZE=0x1000 +ARCH=sh diff --git a/gnu/dist/ld/emulparams/shunx.sh b/gnu/dist/ld/emulparams/shunx.sh new file mode 100644 index 000000000000..980fbeff5be8 --- /dev/null +++ b/gnu/dist/ld/emulparams/shunx.sh @@ -0,0 +1,5 @@ +SCRIPT_NAME=shunx +OUTPUT_FORMAT="coff-sh" +TEXT_START_ADDR=0x1000 +TARGET_PAGE_SIZE=0x1000 +ARCH=sh diff --git a/gnu/dist/ld/scripttempl/shunx.sc b/gnu/dist/ld/scripttempl/shunx.sc new file mode 100644 index 000000000000..64444e551532 --- /dev/null +++ b/gnu/dist/ld/scripttempl/shunx.sc @@ -0,0 +1,53 @@ +TORS=".tors : + { + ___ctors = . ; + *(.ctors) + ___ctors_end = . ; + ___dtors = . ; + *(.dtors) + ___dtors_end = . ; + }" + + +cat < @@ -13,6 +13,7 @@ ELF_PLEASE= (${MACHINE_ARCH} == "mipseb") || \ (${MACHINE_ARCH} == "mipsel") || \ (${MACHINE_ARCH} == "powerpc") || \ + (${MACHINE_ARCH} == "sh3") || \ (${MACHINE_ARCH} == "sparc" && defined(ELF_PLEASE)) || \ (${MACHINE_ARCH} == "sparc64") PROG= ld @@ -72,6 +73,14 @@ DEFAULT_EMUL.mipsel= elf32lmip EMULS.powerpc= elf32ppc DEFAULT_EMUL.powerpc= elf32ppc +##### sh3 ##### +EMULS.sh3= shunx shlunx elf32shunx elf32shlunx +.if defined(ELF_PLEASE) +DEFAULT_EMUL.sh3= elf32shunx +.else +DEFAULT_EMUL.sh3= shunx +.endif + ##### sparc ##### EMULS.sparc= sparcnbsd elf32_sparc sun4 .if defined(ELF_PLEASE) @@ -86,7 +95,8 @@ DEFAULT_EMUL.sparc64= elf64_sparc ALL_EMULS!= (for i in ${EMULS.alpha} ${EMULS.i386} ${EMULS.m68k} \ ${EMULS.mipseb} ${EMULS.mipsel} ${EMULS.powerpc} \ - ${EMULS.sparc} ${EMULS.sparc64}; do echo $$i; done) | \ + ${EMULS.sh3} ${EMULS.sparc} ${EMULS.sparc64}; \ + do echo $$i; done) | \ sort | uniq LIB_PATH= ${LIBDIR} # passed to genscripts