From 2d92cb7d27c686aafda2ebae33fe131f035896d7 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Fri, 8 Feb 2002 06:39:01 +0000 Subject: Contribute sh64-elf. 2002-01-24 Alexandre Oliva * emulparams/shelf32.sh (STACK_ADDR): Define as formerly defined in OTHER_RELOCATABLE_SECTIONS. 2002-01-18 Alexandre Oliva * emulparams/shelf32.sh (STACK_ADDR): Define. (OTHER_RELOCATABLE_SECTIONS): Renamed to... (OTHER_SECTIONS): this. Removed stack settings. * emulparams/shelf64.sh (OTHER_RELOCATABLE_SECTIONS): Do not set. (OTHER_SECTIONS): Reset after sourcing shelf32.sh. 2001-03-12 DJ Delorie * emultempl/sh64elf.em (sh64_elf_$_before_allocation): Disable relaxing if any shmedia or mixed sections are found. 2001-03-07 DJ Delorie * emultempl/sh64elf.em (sh64_elf_before_allocation): Pass f to einfo. Gracefully decline to output to non-elf formats. 2001-03-06 Hans-Peter Nilsson * emulparams/shelf64.sh (OTHER_RELOCATING_SECTIONS) <.stack>: Default to _end aligned to next multiple of 0x40000, plus 0x40000. * emulparams/shelf32.sh: Ditto. 2001-01-14 Hans-Peter Nilsson * emulparams/shelf32.sh (OTHER_RELOCATING_SECTIONS): Tweak comment. 2001-01-10 Ben Elliston * emulparams/shelf32.sh (OTHER_RELOCATING_SECTIONS): Avoid non-portable shell constructs. From Hans-Peter Nilsson. 2001-01-09 Hans-Peter Nilsson * emulparams/shelf64.sh (EXTRA_EM_FILE): Define empty. * Makefile.am (eshelf64.c, eshlelf64.c, eshlelf32.c): Adjust dependencies to the shell script include chain. * Makefile.in: Regenerate. 2001-01-06 Hans-Peter Nilsson * emultempl/sh64elf.em: Update and tweak comments. (sh64_elf_${EMULATION_NAME}_after_allocation): Always allocate and make a .cranges section SEC_IN_MEMORY. 2000-12-30 Hans-Peter Nilsson * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation): Don't stop when .cranges section found to be necessary; continue and set stored section contents flags for sections with non-mixed contents. Use a struct sh64_section_data container and sh64_elf_section_data to store contents-type flags. Remove unused update of "isec". (sh64_elf_${EMULATION_NAME}_after_allocation): Only process sections marked SHF_SH5_ISA32_MIXED. Use sh64_elf_section_data to access contents-type flags. Assert that the associated container is initialized. Use that container, not elf_gp_size, to hold size of linker-generated cranges contents. 2000-12-18 Hans-Peter Nilsson * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation): Exit early if there's already a .cranges section. When section flag difference is found, don't NULL-check cranges a second time. Tweak comments. (sh64_elf_${EMULATION_NAME}_after_allocation): Use size after merging, not max size, as size of ld-generated .cranges contents. Don't set ELF section flags in output section. When checking for needed .cranges descriptors, don't use a variable; compare incoming ELF section flags directly to SHF_SH5_ISA32_MIXED. Tweak comments. 2000-12-18 Hans-Peter Nilsson * emultempl/sh64elf.em: New file. * Makefile.am (eshelf32.c, eshlelf32.c): Adjust dependencies. * Makefile.in: Regenerate. * emulparams/shelf32.sh (OUTPUT_FORMAT): Only set if not set. (OTHER_RELOCATING_SECTIONS): Ditto. (EXTRA_EM_FILE): New, set to sh64elf if not set. * emulparams/shlelf32.sh: Stub out all settings except OUTPUT_FORMAT. Source shelf32.sh. * emulparams/shelf64.sh: Similar, but also keep ELF_SIZE and OTHER_RELOCATING_SECTIONS. (OTHER_RELOCATING_SECTIONS): Remove .cranges. * emulparams/shlelf64.sh: Stub out all settings except OUTPUT_FORMAT. Source shelf64.sh. 2000-12-15 Hans-Peter Nilsson * emulparams/shelf64.sh (OTHER_RELOCATING_SECTIONS): Include .cranges section. (DATA_START_SYMBOLS): Define, provide ___data. (OTHER_READONLY_SYMBOLS): Define, provide ___rodata and align to 8 for consecutive .data section. (OTHER_GOT_SECTIONS): Define, align to 8 for consecutive .bss section after .data section. * emulparams/shlelf64.sh: Ditto. * emulparams/shelf32.sh: Ditto. (ALIGNMENT): Define to 8. * emulparams/shelf32.sh: Ditto. 2000-12-12 Hans-Peter Nilsson * configure.tgt (sh64-*-elf*): Assign targ_extra_libpath to get built-in linker scripts. 2000-11-30 Hans-Peter Nilsson * emulparams/shlelf64.sh: New. * emulparams/shelf64.sh: New. * configure.tgt (sh64-*-elf*): Add shelf64 and shlelf64 to targ_extra_emuls. * Makefile.am: Add support for shlelf64 and shelf64. * Makefile.in: Regenerate. 2000-11-29 Hans-Peter Nilsson * configure.tgt (sh64-*-elf*): Add shelf as default. Add shlelf to targ_extra_emuls. 2000-11-24 Hans-Peter Nilsson * emulparams/shelf32.sh: New file. * emulparams/shlelf32.sh: New file. * Makefile.am: Add support for shlelf32 and shelf32. * configure.tgt: Map sh64-*-elf* to shlelf32 and shelf32. * Makefile.in: Regenerate. --- ld/emulparams/shelf32.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ ld/emulparams/shelf64.sh | 9 +++++++++ ld/emulparams/shlelf32.sh | 2 ++ ld/emulparams/shlelf64.sh | 2 ++ 4 files changed, 56 insertions(+) create mode 100644 ld/emulparams/shelf32.sh create mode 100644 ld/emulparams/shelf64.sh create mode 100644 ld/emulparams/shlelf32.sh create mode 100644 ld/emulparams/shlelf64.sh (limited to 'ld/emulparams') diff --git a/ld/emulparams/shelf32.sh b/ld/emulparams/shelf32.sh new file mode 100644 index 0000000..9b0c698 --- /dev/null +++ b/ld/emulparams/shelf32.sh @@ -0,0 +1,43 @@ +# Note: this parameter script is sourced by the other +# sh[l]elf(32|64).sh parameter scripts. +SCRIPT_NAME=elf +OUTPUT_FORMAT=${OUTPUT_FORMAT-"elf32-sh64"} +TEXT_START_ADDR=0x1000 +STACK_ADDR='ALIGN (0x40000) + 0x40000' +MAXPAGESIZE=128 +ARCH=sh +MACHINE= +ALIGNMENT=8 +TEMPLATE_NAME=elf32 +GENERATE_SHLIB_SCRIPT=yes +EMBEDDED=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);' + +# These are for compatibility with the COFF toolchain. +ENTRY=start +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 "}". +OTHER_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} diff --git a/ld/emulparams/shelf64.sh b/ld/emulparams/shelf64.sh new file mode 100644 index 0000000..2c9a9c5 --- /dev/null +++ b/ld/emulparams/shelf64.sh @@ -0,0 +1,9 @@ +# Note: this is sourced in turn by shlelf64.sh +OUTPUT_FORMAT=${OUTPUT_FORMAT-"elf64-sh64"} +ELFSIZE=64 + +EXTRA_EM_FILE= +. ${srcdir}/emulparams/shelf32.sh + +# We do not need .cranges +OTHER_SECTIONS='' diff --git a/ld/emulparams/shlelf32.sh b/ld/emulparams/shlelf32.sh new file mode 100644 index 0000000..68c85dd --- /dev/null +++ b/ld/emulparams/shlelf32.sh @@ -0,0 +1,2 @@ +OUTPUT_FORMAT="elf32-sh64l" +. ${srcdir}/emulparams/shelf32.sh diff --git a/ld/emulparams/shlelf64.sh b/ld/emulparams/shlelf64.sh new file mode 100644 index 0000000..874b00c --- /dev/null +++ b/ld/emulparams/shlelf64.sh @@ -0,0 +1,2 @@ +OUTPUT_FORMAT="elf64-sh64l" +. ${srcdir}/emulparams/shelf64.sh -- cgit v1.1