diff options
| author | msaitoh <msaitoh@NetBSD.org> | 1999-12-26 19:59:22 +0000 |
|---|---|---|
| committer | msaitoh <msaitoh@NetBSD.org> | 1999-12-26 19:59:22 +0000 |
| commit | 5efb71755dfad00d5c2219d45f35fa73d45b8850 (patch) | |
| tree | ffa4b6db14f7e77632050384e7fc2dabc9b58675 /gnu | |
| parent | bec61173c4eb929a57d021936c81d18c1b10e018 (diff) | |
ld.new for NetBSD/sh3
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/dist/ld/Makefile.am | 12 | ||||
| -rw-r--r-- | gnu/dist/ld/Makefile.in | 12 | ||||
| -rw-r--r-- | gnu/dist/ld/emulparams/elf32shlunx.sh | 15 | ||||
| -rw-r--r-- | gnu/dist/ld/emulparams/elf32shunx.sh | 15 | ||||
| -rw-r--r-- | gnu/dist/ld/emulparams/shlunx.sh | 5 | ||||
| -rw-r--r-- | gnu/dist/ld/emulparams/shunx.sh | 5 | ||||
| -rw-r--r-- | gnu/dist/ld/scripttempl/shunx.sc | 53 | ||||
| -rw-r--r-- | gnu/usr.bin/ld.new/Makefile | 14 |
8 files changed, 129 insertions, 2 deletions
diff --git a/gnu/dist/ld/Makefile.am b/gnu/dist/ld/Makefile.am index eaecd49c63a..be5666d9bbc 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 1f6b72db304..68e0ad4df17 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 00000000000..611fa1b5bae --- /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 00000000000..7ac622326b9 --- /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 00000000000..e6a48edbc1c --- /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 00000000000..980fbeff5be --- /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 00000000000..64444e55153 --- /dev/null +++ b/gnu/dist/ld/scripttempl/shunx.sc @@ -0,0 +1,53 @@ +TORS=".tors : + { + ___ctors = . ; + *(.ctors) + ___ctors_end = . ; + ___dtors = . ; + *(.dtors) + ___dtors_end = . ; + }" + + +cat <<EOF +OUTPUT_FORMAT("${OUTPUT_FORMAT}") +OUTPUT_ARCH(${ARCH}) +${LIB_SEARCH_DIRS} + +SECTIONS +{ + . = ${TEXT_START_ADDR} + SIZEOF_HEADERS; + .text ALIGN(0x10): + { + *(.text) + *(.strings) + ${RELOCATING+ _etext = . ; } + } + ${CONSTRUCTING+${TORS}} + .data ${RELOCATING+ ALIGN(${TARGET_PAGE_SIZE})} : + { + *(.data) + ${RELOCATING+ _edata = . ; } + } + .bss ${RELOCATING+ ALIGN(${TARGET_PAGE_SIZE})} : + { + ${RELOCATING+ _bss_start = . ; } + *(.bss) + *(COMMON) + ${RELOCATING+ _end = . ; } + } + .stack : + { + ${RELOCATING+ _stack = . ; } + *(.stack) + } + .stab 0 ${RELOCATING+(NOLOAD)} : + { + *(.stab) + } + .stabstr 0 ${RELOCATING+(NOLOAD)} : + { + *(.stabstr) + } +} +EOF diff --git a/gnu/usr.bin/ld.new/Makefile b/gnu/usr.bin/ld.new/Makefile index 54c31e6e487..0f71609984f 100644 --- a/gnu/usr.bin/ld.new/Makefile +++ b/gnu/usr.bin/ld.new/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.15 1999/08/21 06:30:12 simonb Exp $ +# $NetBSD: Makefile,v 1.16 1999/12/26 19:59:23 msaitoh Exp $ # for OBJECT_FMT, UNPRIVILEGED .include <bsd.own.mk> @@ -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 |
