From a2b3c630417d8e4a7513f3e86689ae0767b8bef8 Mon Sep 17 00:00:00 2001 From: Stephen Clarke Date: Wed, 9 Oct 2002 19:09:59 +0000 Subject: [PATCH] * Makefile.am: Add eshelf32_linux.o and eshlelf32_linux.o, new emulations for sh64 Linux. * Makefile.in: Regenerate. * configure.tgt: Add sh64eb-*-linux* and sh64-*-linux* emulations. * emulparams/shelf32_linux.sh: New file. * emulparams/shlelf32_linux.sh: New file. --- ld/ChangeLog | 10 ++++++++ ld/Makefile.am | 14 +++++++++++ ld/Makefile.in | 14 +++++++++++ ld/configure.tgt | 7 ++++++ ld/emulparams/shelf32_linux.sh | 2 ++ ld/emulparams/shlelf32_linux.sh | 41 +++++++++++++++++++++++++++++++++ 6 files changed, 88 insertions(+) create mode 100644 ld/emulparams/shelf32_linux.sh create mode 100644 ld/emulparams/shlelf32_linux.sh diff --git a/ld/ChangeLog b/ld/ChangeLog index 48764f52dc7..e4ffc360c73 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,13 @@ +2002-10-09 Richard Shann + Stephen Clarke + + * Makefile.am: Add eshelf32_linux.o and + eshlelf32_linux.o, new emulations for sh64 Linux. + * Makefile.in: Regenerate. + * configure.tgt: Add sh64eb-*-linux* and sh64-*-linux* emulations. + * emulparams/shelf32_linux.sh: New file. + * emulparams/shlelf32_linux.sh: New file. + 2002-10-08 H.J. Lu * ldlang.c (lang_file_exist): Removed. diff --git a/ld/Makefile.am b/ld/Makefile.am index c89d37bd6d5..f098429b21a 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -261,6 +261,8 @@ ALL_EMULATIONS = \ esh.o \ eshelf32.o \ eshlelf32.o \ + eshelf32_linux.o \ + eshlelf32_linux.o \ eshelf32_nbsd.o \ eshlelf32_nbsd.o \ eshelf.o \ @@ -986,6 +988,12 @@ eshelf32.c: $(srcdir)/emulparams/shelf32.sh \ $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} shelf32 "$(tdir_shelf32)" +eshelf32_linux.c: $(srcdir)/emulparams/shelf32_linux.sh \ + $(srcdir)/emulparams/shelf32.sh \ + $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \ + $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} shelf32_linux "$(tdir_shelf32_linux)" eshelf32_nbsd.c: $(srcdir)/emulparams/shelf32_nbsd.sh \ $(srcdir)/emulparams/shelf32.sh \ $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \ @@ -1030,6 +1038,12 @@ eshlelf32.c: $(srcdir)/emulparams/shlelf32.sh \ $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} shlelf32 "$(tdir_shlelf32)" +eshlelf32_linux.c: $(srcdir)/emulparams/shlelf32_linux.sh \ + $(srcdir)/emulparams/shelf32_linux.sh $(srcdir)/emulparams/shelf32.sh \ + $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \ + $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} shlelf32_linux "$(tdir_shlelf32_linux)" eshlelf32_nbsd.c: $(srcdir)/emulparams/shlelf32_nbsd.sh \ $(srcdir)/emulparams/shelf32_nbsd.sh $(srcdir)/emulparams/shelf32.sh \ $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \ diff --git a/ld/Makefile.in b/ld/Makefile.in index b038e17b9e9..c89f5c9e9b5 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -372,6 +372,8 @@ ALL_EMULATIONS = \ esh.o \ eshelf32.o \ eshlelf32.o \ + eshelf32_linux.o \ + eshlelf32_linux.o \ eshelf32_nbsd.o \ eshlelf32_nbsd.o \ eshelf.o \ @@ -1709,6 +1711,12 @@ eshelf32.c: $(srcdir)/emulparams/shelf32.sh \ $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} shelf32 "$(tdir_shelf32)" +eshelf32_linux.c: $(srcdir)/emulparams/shelf32_linux.sh \ + $(srcdir)/emulparams/shelf32.sh \ + $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \ + $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} shelf32_linux "$(tdir_shelf32_linux)" eshelf32_nbsd.c: $(srcdir)/emulparams/shelf32_nbsd.sh \ $(srcdir)/emulparams/shelf32.sh \ $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \ @@ -1753,6 +1761,12 @@ eshlelf32.c: $(srcdir)/emulparams/shlelf32.sh \ $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} shlelf32 "$(tdir_shlelf32)" +eshlelf32_linux.c: $(srcdir)/emulparams/shlelf32_linux.sh \ + $(srcdir)/emulparams/shelf32_linux.sh $(srcdir)/emulparams/shelf32.sh \ + $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \ + $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} shlelf32_linux "$(tdir_shlelf32_linux)" eshlelf32_nbsd.c: $(srcdir)/emulparams/shlelf32_nbsd.sh \ $(srcdir)/emulparams/shelf32_nbsd.sh $(srcdir)/emulparams/shelf32.sh \ $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \ diff --git a/ld/configure.tgt b/ld/configure.tgt index f4afabde6d6..48b2c5c045b 100644 --- a/ld/configure.tgt +++ b/ld/configure.tgt @@ -269,6 +269,13 @@ sh-*-linux*) targ_extra_emuls=shelf_linux targ_extra_libpath=shelf_linux ;; +sh64eb-*-linux*) targ_emul=shelf32_linux + targ_extra_emuls="shlelf32_linux" + ;; +sh64-*-linux*) targ_emul=shlelf32_linux + targ_extra_emuls="shelf32_linux" + targ_extra_libpath=shelf32_linux + ;; sh*eb-*-linux*) targ_emul=shelf_linux ;; diff --git a/ld/emulparams/shelf32_linux.sh b/ld/emulparams/shelf32_linux.sh new file mode 100644 index 00000000000..a51e22fb8db --- /dev/null +++ b/ld/emulparams/shelf32_linux.sh @@ -0,0 +1,2 @@ +. ${srcdir}/emulparams/shlelf32_linux.sh +OUTPUT_FORMAT="elf32-sh64big-linux" diff --git a/ld/emulparams/shlelf32_linux.sh b/ld/emulparams/shlelf32_linux.sh new file mode 100644 index 00000000000..01b9ce36c98 --- /dev/null +++ b/ld/emulparams/shlelf32_linux.sh @@ -0,0 +1,41 @@ +# If you change this file, please also look at files which source this one: +# shelf32_linux.sh + +SCRIPT_NAME=elf +OUTPUT_FORMAT="elf32-sh64-linux" +TEXT_START_ADDR=0x400000 +MAXPAGESIZE=0x10000 +ARCH=sh +MACHINE=sh5 +ALIGNMENT=8 +TEMPLATE_NAME=elf32 +GENERATE_SHLIB_SCRIPT=yes + + +DATA_START_SYMBOLS='PROVIDE (___data = .);' + +# If data is located right after .text (not explicitly specified), +# then we need to align it to an 8-byte boundary. +OTHER_READONLY_SECTIONS=' +PROVIDE (___rodata = DEFINED (.rodata) ? .rodata : 0); +. = ALIGN (8); +' + +# Make _edata and .bss aligned by smuggling in an alignment directive. +OTHER_GOT_SECTIONS='. = ALIGN (8);' + +CTOR_START='___ctors = .;' +CTOR_END='___ctors_end = .;' +DTOR_START='___dtors = .;' +DTOR_END='___dtors_end = .;' + +# Do not use the varname=${varname-'string'} construct here; there are +# problems with that on some shells (e.g. on Solaris) where there is a bug +# that trigs when $varname contains a "}". +test -z "$OTHER_RELOCATING_SECTIONS" && OTHER_RELOCATING_SECTIONS=' + .cranges 0 : { *(.cranges) } +' + +# We need to adjust sizes in the .cranges section after relaxation, so +# we need an after_allocation function, and it goes in this file. +EXTRA_EM_FILE=${EXTRA_EM_FILE-sh64elf} -- 2.30.2