summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/ld/emulparams
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2004-05-17 20:42:59 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2004-05-17 20:42:59 +0000
commitdabfd0a2b923dc8dd2fab68d1669102a0aa4352c (patch)
treed015d45f09daaa846ca3dc8ca58b731e65c28eea /gnu/usr.bin/binutils/ld/emulparams
parentb92d90de71fbbb34bdcd7269aa7b30856e0b4f06 (diff)
import binutils 2.14 (excluding testsuites, .info files, and .po files)
Diffstat (limited to 'gnu/usr.bin/binutils/ld/emulparams')
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/aix5ppc.sh6
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/aix5rs6.sh6
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/armelf.sh8
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/armelf_fbsd.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/armelf_linux.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/armelf_nbsd.sh6
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/armelf_oabi.sh5
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/armelfb_nbsd.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/armnto.sh24
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avr1.sh10
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avr1200.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avr2.sh10
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avr23xx.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avr3.sh10
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avr4.sh10
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avr4433.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avr44x4.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avr5.sh10
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avr85xx.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avrmega103.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avrmega161.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/avrmega603.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/criself.sh29
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/crislinux.sh16
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/d10velf.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32_dlx.sh9
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32bmipn32-defs.sh77
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32bmipn32.sh66
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32bsmip.sh31
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32btsmip.sh32
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32btsmipn32.sh16
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32ebmip.sh28
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32elmip.sh28
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32fr30.sh4
-rwxr-xr-xgnu/usr.bin/binutils/ld/emulparams/elf32frv.sh18
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32ip2k.sh19
-rwxr-xr-xgnu/usr.bin/binutils/ld/emulparams/elf32iq10.sh11
-rwxr-xr-xgnu/usr.bin/binutils/ld/emulparams/elf32iq2000.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32lppcnto.sh5
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32lppcsim.sh18
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32lsmip.sh31
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32ltsmip.sh31
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32ltsmipn32.sh4
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32mcore.sh7
-rwxr-xr-xgnu/usr.bin/binutils/ld/emulparams/elf32openrisc.sh10
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32ppc_fbsd.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32ppclinux.sh24
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32ppcnto.sh4
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32ppcsim.sh18
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32ppcwindiss.sh23
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32vax.sh11
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32xstormy16.sh13
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32xtensa.sh32
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64_aix.sh21
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64_ia64.sh18
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64_ia64_fbsd.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64_s390.sh32
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64_sparc_fbsd.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64alpha_fbsd.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64alpha_nbsd.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64bmip.sh63
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64btsmip.sh39
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64hppa.sh42
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64lppc.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64ltsmip.sh42
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64mmix.sh61
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64ppc.sh47
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf_fbsd.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf_i386_be.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf_i386_chaos.sh5
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf_i386_fbsd.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf_i386_ldso.sh12
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf_s390.sh10
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf_x86_64_fbsd.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/h8300elf.sh12
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/h8300helf.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/h8300hn.sh5
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/h8300hnelf.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/h8300self.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/h8300sn.sh5
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/h8300snelf.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/hppa64linux.sh58
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/hppalinux.sh6
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/hppanbsd.sh6
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/i386nto.sh12
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/m32relf.sh5
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/m68hc11elf.sh5
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/m68hc11elfb.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/m68hc12elf.sh5
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/m68hc12elfb.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/m68kelfnbsd.sh4
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/mmo.sh10
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/mn10200.sh9
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/mn10300.sh19
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x110.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x1101.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x1111.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x112.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x1121.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x1122.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x1132.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x122.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x1222.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x123.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x1232.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x133.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x1331.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x135.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x1351.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x147.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x148.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x149.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x155.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x156.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x157.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x167.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x168.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x169.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x311.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x312.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x313.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x314.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x315.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x323.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x325.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x336.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x337.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x412.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x413.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x435.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x436.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x437.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x447.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x448.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/msp430x449.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/or32.sh6
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/or32elf.sh6
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/pdp11.sh5
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shelf.sh17
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shelf32.sh43
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shelf32_linux.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shelf32_nbsd.sh13
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shelf64.sh9
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shelf64_nbsd.sh8
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shelf_linux.sh14
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shelf_nbsd.sh15
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shelf_nto.sh10
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shlelf.sh17
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shlelf32.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shlelf32_linux.sh41
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shlelf32_nbsd.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shlelf64.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shlelf64_nbsd.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shlelf_linux.sh8
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shlelf_nbsd.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shlelf_nto.sh10
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/tic3xcoff.sh6
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/tic3xcoff_onchip.sh8
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/tic4xcoff.sh6
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/v850.sh1
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/vaxnbsd.sh7
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/xtensa-config.sh3
162 files changed, 1625 insertions, 558 deletions
diff --git a/gnu/usr.bin/binutils/ld/emulparams/aix5ppc.sh b/gnu/usr.bin/binutils/ld/emulparams/aix5ppc.sh
new file mode 100644
index 00000000000..ff9453056a7
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/aix5ppc.sh
@@ -0,0 +1,6 @@
+TEMPLATE_NAME=aix
+SCRIPT_NAME=aix
+OUTPUT_FORMAT="aixcoff-rs6000"
+OUTPUT_FORMAT_32BIT="aixcoff-rs6000"
+OUTPUT_FORMAT_64BIT="aix5coff64-rs6000"
+ARCH=powerpc
diff --git a/gnu/usr.bin/binutils/ld/emulparams/aix5rs6.sh b/gnu/usr.bin/binutils/ld/emulparams/aix5rs6.sh
new file mode 100644
index 00000000000..958e4c1fc15
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/aix5rs6.sh
@@ -0,0 +1,6 @@
+TEMPLATE_NAME=aix
+SCRIPT_NAME=aix
+OUTPUT_FORMAT="aixcoff-rs6000"
+OUTPUT_FORMAT_32BIT="aixcoff-rs6000"
+OUTPUT_FORMAT_64BIT="aix5coff64-rs6000"
+ARCH=rs6000
diff --git a/gnu/usr.bin/binutils/ld/emulparams/armelf.sh b/gnu/usr.bin/binutils/ld/emulparams/armelf.sh
index 338b9ceb2e1..9e2ada7b1ea 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/armelf.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/armelf.sh
@@ -7,9 +7,12 @@ TEXT_START_ADDR=0x8000
TEMPLATE_NAME=elf32
EXTRA_EM_FILE=armelf
OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
+OTHER_READONLY_SECTIONS='.note.gnu.arm.ident : { KEEP (*(.note.gnu.arm.ident)) }'
OTHER_BSS_SYMBOLS='__bss_start__ = .;'
OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;'
+DATA_START_SYMBOLS='__data_start = . ;';
+
GENERATE_SHLIB_SCRIPT=yes
ARCH=arm
@@ -18,6 +21,5 @@ MAXPAGESIZE=256
ENTRY=_start
EMBEDDED=yes
-# Hmmm, there's got to be a better way. This sets the stack to the
-# top of the simulator memory (2^19 bytes).
-OTHER_RELOCATING_SECTIONS='.stack 0x80000 : { _stack = .; *(.stack) }'
+# This sets the stack to the top of the simulator memory (2^19 bytes).
+STACK_ADDR=0x80000
diff --git a/gnu/usr.bin/binutils/ld/emulparams/armelf_fbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/armelf_fbsd.sh
new file mode 100644
index 00000000000..52da34557d1
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/armelf_fbsd.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/armelf.sh
+. ${srcdir}/emulparams/elf_fbsd.sh
diff --git a/gnu/usr.bin/binutils/ld/emulparams/armelf_linux.sh b/gnu/usr.bin/binutils/ld/emulparams/armelf_linux.sh
index d04d967b87a..f03fb760372 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/armelf_linux.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/armelf_linux.sh
@@ -10,6 +10,7 @@ GENERATE_SHLIB_SCRIPT=yes
DATA_START_SYMBOLS='__data_start = . ;';
OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
+OTHER_READONLY_SECTIONS='.note.gnu.arm.ident : { KEEP (*(.note.gnu.arm.ident)) }'
OTHER_BSS_SYMBOLS='__bss_start__ = .;'
OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/armelf_nbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/armelf_nbsd.sh
new file mode 100644
index 00000000000..571483c69bf
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/armelf_nbsd.sh
@@ -0,0 +1,6 @@
+. ${srcdir}/emulparams/armelf.sh
+MAXPAGESIZE=0x8000
+TEXT_START_ADDR=0x00008000
+
+unset STACK_ADDR
+unset EMBEDDED
diff --git a/gnu/usr.bin/binutils/ld/emulparams/armelf_oabi.sh b/gnu/usr.bin/binutils/ld/emulparams/armelf_oabi.sh
index d568328d63a..f1c967dcb66 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/armelf_oabi.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/armelf_oabi.sh
@@ -16,6 +16,5 @@ MAXPAGESIZE=256
ENTRY=_start
EMBEDDED=yes
-# Hmmm, there's got to be a better way. This sets the stack to the
-# top of the simulator memory (2^19 bytes).
-OTHER_RELOCATING_SECTIONS='.stack 0x80000 : { _stack = .; *(.stack) }'
+# This sets the stack to the top of the simulator memory (2^19 bytes).
+STACK_ADDR=0x80000
diff --git a/gnu/usr.bin/binutils/ld/emulparams/armelfb_nbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/armelfb_nbsd.sh
new file mode 100644
index 00000000000..7ab6ce06a51
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/armelfb_nbsd.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/armelf_nbsd.sh
+OUTPUT_FORMAT="elf32-bigarm"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/armnto.sh b/gnu/usr.bin/binutils/ld/emulparams/armnto.sh
new file mode 100644
index 00000000000..d000de3bb49
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/armnto.sh
@@ -0,0 +1,24 @@
+MACHINE=
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-littlearm"
+BIG_OUTPUT_FORMAT="elf32-bigarm"
+LITTLE_OUTPUT_FORMAT="elf32-littlearm"
+TEXT_START_ADDR=0x00100000
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=armelf
+OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)'
+OTHER_BSS_SYMBOLS='__bss_start__ = .;'
+OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;'
+
+DATA_START_SYMBOLS='__data_start = . ;';
+
+GENERATE_SHLIB_SCRIPT=yes
+
+ARCH=arm
+MACHINE=
+MAXPAGESIZE=0x1000
+
+ENTRY=_start
+
+# This sets the stack to the top of the simulator memory (2^19 bytes).
+STACK_ADDR=0x80000
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avr1.sh b/gnu/usr.bin/binutils/ld/emulparams/avr1.sh
new file mode 100644
index 00000000000..4ccc9ed34f3
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/avr1.sh
@@ -0,0 +1,10 @@
+ARCH=avr:1
+MACHINE=
+SCRIPT_NAME=avr
+OUTPUT_FORMAT="elf32-avr"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+TEXT_LENGTH=8K
+DATA_LENGTH=0
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avr1200.sh b/gnu/usr.bin/binutils/ld/emulparams/avr1200.sh
index 24607e5f6ff..0bbcecd8ed9 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/avr1200.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/avr1200.sh
@@ -9,4 +9,5 @@ TEMPLATE_NAME=generic
TEXT_LENGTH=1K
DATA_LENGTH=0
EEPROM_LENGTH=64
+DATA_START=0x60
STACK=0
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avr2.sh b/gnu/usr.bin/binutils/ld/emulparams/avr2.sh
new file mode 100644
index 00000000000..9c98ce1dd68
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/avr2.sh
@@ -0,0 +1,10 @@
+ARCH=avr:2
+MACHINE=
+SCRIPT_NAME=avr
+OUTPUT_FORMAT="elf32-avr"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+TEXT_LENGTH=8K
+DATA_LENGTH=0xffa0
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avr23xx.sh b/gnu/usr.bin/binutils/ld/emulparams/avr23xx.sh
index e85ef8621a9..49bd5adbc92 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/avr23xx.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/avr23xx.sh
@@ -9,5 +9,6 @@ TEMPLATE_NAME=generic
TEXT_LENGTH=2K
DATA_LENGTH=128
EEPROM_LENGTH=128
+DATA_START=0x60
STACK=0x0DF
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avr3.sh b/gnu/usr.bin/binutils/ld/emulparams/avr3.sh
new file mode 100644
index 00000000000..0434d074dec
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/avr3.sh
@@ -0,0 +1,10 @@
+ARCH=avr:3
+MACHINE=
+SCRIPT_NAME=avr
+OUTPUT_FORMAT="elf32-avr"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+TEXT_LENGTH=128K
+DATA_LENGTH=0xffa0
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avr4.sh b/gnu/usr.bin/binutils/ld/emulparams/avr4.sh
new file mode 100644
index 00000000000..33fc83aff51
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/avr4.sh
@@ -0,0 +1,10 @@
+ARCH=avr:4
+MACHINE=
+SCRIPT_NAME=avr
+OUTPUT_FORMAT="elf32-avr"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+TEXT_LENGTH=8K
+DATA_LENGTH=0xffa0
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avr4433.sh b/gnu/usr.bin/binutils/ld/emulparams/avr4433.sh
index 179fe1c6765..0cfb4710988 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/avr4433.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/avr4433.sh
@@ -9,5 +9,6 @@ TEMPLATE_NAME=generic
TEXT_LENGTH=4K
DATA_LENGTH=128
EEPROM_LENGTH=256
+DATA_START=0x60
STACK=0x0DF
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avr44x4.sh b/gnu/usr.bin/binutils/ld/emulparams/avr44x4.sh
index 07fc57ec06e..7e9fa48fc4c 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/avr44x4.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/avr44x4.sh
@@ -9,5 +9,6 @@ TEMPLATE_NAME=generic
TEXT_LENGTH=4K
DATA_LENGTH=256
EEPROM_LENGTH=256
+DATA_START=0x60
STACK=0x15F
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avr5.sh b/gnu/usr.bin/binutils/ld/emulparams/avr5.sh
new file mode 100644
index 00000000000..5b175b82f04
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/avr5.sh
@@ -0,0 +1,10 @@
+ARCH=avr:5
+MACHINE=
+SCRIPT_NAME=avr
+OUTPUT_FORMAT="elf32-avr"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+TEXT_LENGTH=128K
+DATA_LENGTH=0xffa0
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avr85xx.sh b/gnu/usr.bin/binutils/ld/emulparams/avr85xx.sh
index f3700bd8c36..f925795045f 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/avr85xx.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/avr85xx.sh
@@ -9,5 +9,6 @@ TEMPLATE_NAME=generic
TEXT_LENGTH=8K
DATA_LENGTH=512
EEPROM_LENGTH=512
+DATA_START=0x60
STACK=0x25F
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avrmega103.sh b/gnu/usr.bin/binutils/ld/emulparams/avrmega103.sh
index ca5a61e54b5..5a59b35bf9c 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/avrmega103.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/avrmega103.sh
@@ -9,4 +9,5 @@ TEMPLATE_NAME=generic
TEXT_LENGTH=128K
DATA_LENGTH=4000
EEPROM_LENGTH=4K
+DATA_START=0x60
STACK=0x0FFF
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avrmega161.sh b/gnu/usr.bin/binutils/ld/emulparams/avrmega161.sh
index fa5522216e3..2f97b72c268 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/avrmega161.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/avrmega161.sh
@@ -9,5 +9,6 @@ TEMPLATE_NAME=generic
TEXT_LENGTH=16K
DATA_LENGTH=1K
EEPROM_LENGTH=512
+DATA_START=0x60
STACK=0x45F
diff --git a/gnu/usr.bin/binutils/ld/emulparams/avrmega603.sh b/gnu/usr.bin/binutils/ld/emulparams/avrmega603.sh
index 4d60895650c..e4823fa7241 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/avrmega603.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/avrmega603.sh
@@ -9,4 +9,5 @@ TEMPLATE_NAME=generic
TEXT_LENGTH=64K
DATA_LENGTH=4000
EEPROM_LENGTH=2K
+DATA_START=0x60
STACK=0x0FFF
diff --git a/gnu/usr.bin/binutils/ld/emulparams/criself.sh b/gnu/usr.bin/binutils/ld/emulparams/criself.sh
index 4acd56a35b5..91fdcc5980d 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/criself.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/criself.sh
@@ -15,14 +15,16 @@ TEXT_START_ADDR=0
# Put crt0 for flash/eprom etc. in this section.
INITIAL_READONLY_SECTIONS='.startup : { KEEP(*(.startup)) }'
-# TEXT_START_SYMBOLS doesn't get what we want which is the start of
-# all read-only sections; there's at least .init and .fini before it.
-# We have to resort to trickery.
-#
+# Setting __Stext to . in TEXT_START_SYMBOLS doesn't get what we want
+# most of the time, which is the start of all read-only sections;
+# there's at least .startup and .init before it. We have to resort to
+# trickery. Note that __Stext is always defined, not PROVIDE:d, since
+# external tools look for it.
+TEXT_START_SYMBOLS='__Stext = ADDR (.startup);'
+
# The __start dance is to get us through assumptions about entry
# symbols, and to clear _start for normal use with sane programs.
EXECUTABLE_SYMBOLS='
-PROVIDE (__Stext = .);
__start = DEFINED(__start) ? __start :
DEFINED(_start) ? _start :
DEFINED(start) ? start :
@@ -30,11 +32,11 @@ __start = DEFINED(__start) ? __start :
'
# Smuggle an "OTHER_TEXT_END_SYMBOLS" here.
-OTHER_READONLY_SECTIONS='PROVIDE (__Etext = .);'
+OTHER_READONLY_SECTIONS="${RELOCATING+PROVIDE (__Etext = .);}"
DATA_START_SYMBOLS='PROVIDE (__Sdata = .);'
# Smuggle an "OTHER_DATA_END_SYMBOLS" here.
-OTHER_GOT_SECTIONS='PROVIDE (__Edata = .);'
+OTHER_SDATA_SECTIONS="${RELOCATING+PROVIDE (__Edata = .);}"
# If .bss does not immediately follow .data but has its own start
# address, we can't get to it with OTHER_BSS_SYMBOLS, neither can we
@@ -43,7 +45,7 @@ OTHER_GOT_SECTIONS='PROVIDE (__Edata = .);'
OTHER_BSS_END_SYMBOLS='
PROVIDE (__Ebss = .);
PROVIDE (__end = .);
- __Sbss = SIZEOF (.sbss) != 0 ? ADDR (.sbss) : ADDR (.bss);
+ __Sbss = ADDR (.bss);
PROVIDE (_bss_start = __Sbss);
'
@@ -93,11 +95,10 @@ CTOR_END='
___elf_ctors_dtors_end = .;
'
-
-# Smuggle an "OTHER_ALL_END_SYMBOLS" here.
# Also add the other symbols provided for rsim/xsim and elinux.
-OTHER_RELOCATING_SECTIONS='
-PROVIDE (__Eall = .);
-PROVIDE (__Endmem = 0x10000000);
-PROVIDE (__Stacksize = 0);
+OTHER_END_SYMBOLS='
+ PROVIDE (__Eall = .);
+ PROVIDE (__Endmem = 0x10000000);
+ PROVIDE (__Stacksize = 0);
'
+NO_SMALL_DATA=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/crislinux.sh b/gnu/usr.bin/binutils/ld/emulparams/crislinux.sh
index 6be4f5803f6..e54f5fbca47 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/crislinux.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/crislinux.sh
@@ -16,26 +16,24 @@ TEXT_START_ADDR=0x80000
MAXPAGESIZE=8192
-# FIXME: GOT, PLT...
-
# We don't do the hoops through DEFINED to provide [_]*start, as it
# doesn't work with --gc-sections, and the start-name is pretty fixed
# anyway.
TEXT_START_SYMBOLS='PROVIDE (__Stext = .);'
# Smuggle an "OTHER_TEXT_END_SYMBOLS" here.
-OTHER_READONLY_SECTIONS='PROVIDE (__Etext = .);'
+OTHER_READONLY_SECTIONS="${RELOCATING+PROVIDE (__Etext = .);}"
DATA_START_SYMBOLS='PROVIDE (__Sdata = .);'
# Smuggle an "OTHER_DATA_END_SYMBOLS" here.
-OTHER_GOT_SECTIONS='PROVIDE (__Edata = .);'
+OTHER_SDATA_SECTIONS="${RELOCATING+PROVIDE (__Edata = .);}"
OTHER_BSS_SYMBOLS='PROVIDE (__Sbss = .);'
OTHER_BSS_END_SYMBOLS='PROVIDE (__Ebss = .);'
-# Smuggle an "OTHER_ALL_END_SYMBOLS" here.
# Also add the other symbols provided for rsim/xsim and elinux.
-OTHER_RELOCATING_SECTIONS='
-PROVIDE (__Eall = .);
-PROVIDE(__Endmem = 0x10000000);
-PROVIDE(__Stacksize = 0);
+OTHER_END_SYMBOLS='
+ PROVIDE (__Eall = .);
+ PROVIDE (__Endmem = 0x10000000);
+ PROVIDE (__Stacksize = 0);
'
+NO_SMALL_DATA=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/d10velf.sh b/gnu/usr.bin/binutils/ld/emulparams/d10velf.sh
index c8c4214edec..c8de5c4a136 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/d10velf.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/d10velf.sh
@@ -1,7 +1,7 @@
MACHINE=
SCRIPT_NAME=elfd10v
OUTPUT_FORMAT="elf32-d10v"
-TEXT_START_ADDR=0x01000000
+TEXT_START_ADDR=0x01014000
READONLY_START_ADDR=0x02000004
ARCH=d10v
MAXPAGESIZE=32
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32_dlx.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32_dlx.sh
new file mode 100644
index 00000000000..d3ff81c3414
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32_dlx.sh
@@ -0,0 +1,9 @@
+SCRIPT_NAME=dlx
+TEMPLATE_NAME=generic
+OUTPUT_FORMAT="elf32-dlx"
+ARCH=dlx
+MACHINE=
+TEXT_START_ADDR=0
+TARGET_PAGE_SIZE=1
+EMBEDDED=yes
+MAXPAGESIZE=1
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32bmipn32-defs.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32bmipn32-defs.sh
new file mode 100644
index 00000000000..790eecf6f8d
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32bmipn32-defs.sh
@@ -0,0 +1,77 @@
+# If you change this file, please also look at files which source this one:
+# elf64bmip.sh elf64btsmip.sh elf32btsmipn32.sh elf32bmipn32.sh
+
+# This is an ELF platform.
+SCRIPT_NAME=elf
+
+# Handle both big- and little-ended 32-bit MIPS objects.
+ARCH=mips
+OUTPUT_FORMAT="elf32-bigmips"
+BIG_OUTPUT_FORMAT="elf32-bigmips"
+LITTLE_OUTPUT_FORMAT="elf32-littlemips"
+
+TEMPLATE_NAME=elf32
+
+case "$EMULATION_NAME" in
+elf32*n32*) ELFSIZE=32 ;;
+elf64*) ELFSIZE=64 ;;
+*) echo $0: unhandled emulation $EMULATION_NAME >&2; exit 1 ;;
+esac
+
+if test `echo "$host" | sed -e s/64//` = `echo "$target" | sed -e s/64//`; then
+ case " $EMULATION_LIBPATH " in
+ *" ${EMULATION_NAME} "*)
+ NATIVE=yes
+ ;;
+ esac
+fi
+
+# Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first.
+LIBPATH_SUFFIX=$ELFSIZE
+
+GENERATE_SHLIB_SCRIPT=yes
+
+TEXT_START_ADDR=0x10000000
+MAXPAGESIZE=0x100000
+ENTRY=__start
+
+# GOT-related settings.
+OTHER_GOT_SYMBOLS='
+ _gp = ALIGN(16) + 0x7ff0;
+'
+OTHER_SDATA_SECTIONS="
+ .lit8 ${RELOCATING-0} : { *(.lit8) }
+ .lit4 ${RELOCATING-0} : { *(.lit4) }
+ .srdata ${RELOCATING-0} : { *(.srdata) }
+"
+
+# Magic symbols.
+TEXT_START_SYMBOLS='_ftext = . ;'
+DATA_START_SYMBOLS='_fdata = . ;'
+OTHER_BSS_SYMBOLS='_fbss = .;'
+
+OTHER_SECTIONS="
+ .MIPS.events.text ${RELOCATING-0} :
+ {
+ *(.MIPS.events.text${RELOCATING+ .MIPS.events.gnu.linkonce.t*})
+ }
+ .MIPS.content.text ${RELOCATING-0} :
+ {
+ *(.MIPS.content.text${RELOCATING+ .MIPS.content.gnu.linkonce.t*})
+ }
+ .MIPS.events.data ${RELOCATING-0} :
+ {
+ *(.MIPS.events.data${RELOCATING+ .MIPS.events.gnu.linkonce.d*})
+ }
+ .MIPS.content.data ${RELOCATING-0} :
+ {
+ *(.MIPS.content.data${RELOCATING+ .MIPS.content.gnu.linkonce.d*})
+ }
+ .MIPS.events.rodata ${RELOCATING-0} :
+ {
+ *(.MIPS.events.rodata${RELOCATING+ .MIPS.events.gnu.linkonce.r*})
+ }
+ .MIPS.content.rodata ${RELOCATING-0} :
+ {
+ *(.MIPS.content.rodata${RELOCATING+ .MIPS.content.gnu.linkonce.r*})
+ }"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32bmipn32.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32bmipn32.sh
index 56f42a9b296..75338379ee1 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32bmipn32.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32bmipn32.sh
@@ -1,32 +1,9 @@
-# This is an ELF platform.
-SCRIPT_NAME=elf
+. ${srcdir}/emulparams/elf32bmipn32-defs.sh
+OUTPUT_FORMAT="elf32-nbigmips"
+BIG_OUTPUT_FORMAT="elf32-nbigmips"
+LITTLE_OUTPUT_FORMAT="elf32-nlittlemips"
+SHLIB_TEXT_START_ADDR=0x5ffe0000
-# Handle both big- and little-ended 32-bit MIPS objects.
-ARCH=mips
-OUTPUT_FORMAT="elf32-bigmips"
-BIG_OUTPUT_FORMAT="elf32-bigmips"
-LITTLE_OUTPUT_FORMAT="elf32-littlemips"
-
-TEMPLATE_NAME=elf32
-
-TEXT_START_ADDR=0x10000000
-MAXPAGESIZE=0x100000
-ENTRY=__start
-
-# GOT-related settings.
-OTHER_GOT_SYMBOLS='
- _gp = ALIGN(16) + 0x7ff0;
-'
-OTHER_GOT_SECTIONS='
- .lit8 : { *(.lit8) }
- .lit4 : { *(.lit4) }
- .srdata : { *(.srdata) }
-'
-
-# Magic symbols.
-TEXT_START_SYMBOLS='_ftext = . ;'
-DATA_START_SYMBOLS='_fdata = . ;'
-OTHER_BSS_SYMBOLS='_fbss = .;'
# IRIX6 defines these symbols. 0x34 is the size of the ELF header.
EXECUTABLE_SYMBOLS="
__dso_displacement = 0;
@@ -40,36 +17,3 @@ EXECUTABLE_SYMBOLS="
# Following the IRIX linker, we simply put .rodata in the data
# segment.
WRITABLE_RODATA=
-
-OTHER_RELOCATING_SECTIONS='
- .MIPS.events.text :
- {
- *(.MIPS.events.text)
- *(.MIPS.events.gnu.linkonce.t*)
- }
- .MIPS.content.text :
- {
- *(.MIPS.content.text)
- *(.MIPS.content.gnu.linkonce.t*)
- }
- .MIPS.events.data :
- {
- *(.MIPS.events.data)
- *(.MIPS.events.gnu.linkonce.d*)
- }
- .MIPS.content.data :
- {
- *(.MIPS.content.data)
- *(.MIPS.content.gnu.linkonce.d*)
- }
- .MIPS.events.rodata :
- {
- *(.MIPS.events.rodata)
- *(.MIPS.events.gnu.linkonce.r*)
- }
- .MIPS.content.rodata :
- {
- *(.MIPS.content.rodata)
- *(.MIPS.content.gnu.linkonce.r*)
- }
-'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32bsmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32bsmip.sh
index 09f13076437..5b2939a94f4 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32bsmip.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32bsmip.sh
@@ -1,31 +1,2 @@
-SCRIPT_NAME=elf
-OUTPUT_FORMAT="elf32-bigmips"
-BIG_OUTPUT_FORMAT="elf32-bigmips"
-LITTLE_OUTPUT_FORMAT="elf32-littlemips"
-TEXT_START_ADDR=0x0400000
-DATA_ADDR=0x10000000
-MAXPAGESIZE=0x40000
-NONPAGED_TEXT_START_ADDR=0x0400000
-SHLIB_TEXT_START_ADDR=0x5ffe0000
-TEXT_DYNAMIC=
-INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
-OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
-OTHER_GOT_SYMBOLS='
- _gp = ALIGN(16) + 0x7ff0;
-'
-OTHER_GOT_SECTIONS='
- .lit8 : { *(.lit8) }
- .lit4 : { *(.lit4) }
-'
-TEXT_START_SYMBOLS='_ftext = . ;'
-DATA_START_SYMBOLS='_fdata = . ;'
-OTHER_BSS_SYMBOLS='_fbss = .;'
-OTHER_SECTIONS='
- .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
- .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
-'
-ARCH=mips
-MACHINE=
-TEMPLATE_NAME=elf32
-GENERATE_SHLIB_SCRIPT=yes
+. ${srcdir}/emulparams/elf32bmip.sh
ENTRY=__start
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32btsmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32btsmip.sh
index f6d1cf265be..4c5a9ab2735 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32btsmip.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32btsmip.sh
@@ -1,31 +1,9 @@
-SCRIPT_NAME=elf
+# If you change this file, please also look at files which source this one:
+# elf32ltsmip.sh
+
+. ${srcdir}/emulparams/elf32bmip.sh
OUTPUT_FORMAT="elf32-tradbigmips"
BIG_OUTPUT_FORMAT="elf32-tradbigmips"
LITTLE_OUTPUT_FORMAT="elf32-tradlittlemips"
-TEXT_START_ADDR=0x0400000
-DATA_ADDR=0x10000000
-MAXPAGESIZE=0x40000
-NONPAGED_TEXT_START_ADDR=0x0400000
-SHLIB_TEXT_START_ADDR=0x0
-TEXT_DYNAMIC=
-INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
-OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
-OTHER_GOT_SYMBOLS='
- _gp = ALIGN(16) + 0x7ff0;
-'
-OTHER_GOT_SECTIONS='
- .lit8 : { *(.lit8) }
- .lit4 : { *(.lit4) }
-'
-TEXT_START_SYMBOLS='_ftext = . ;'
-DATA_START_SYMBOLS='_fdata = . ;'
-OTHER_BSS_SYMBOLS='_fbss = .;'
-OTHER_SECTIONS='
- .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
- .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
-'
-ARCH=mips
-MACHINE=
-TEMPLATE_NAME=elf32
-GENERATE_SHLIB_SCRIPT=yes
+SHLIB_TEXT_START_ADDR=0
ENTRY=__start
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32btsmipn32.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32btsmipn32.sh
new file mode 100644
index 00000000000..d287417e286
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32btsmipn32.sh
@@ -0,0 +1,16 @@
+# If you change this file, please also look at files which source this one:
+# elf32ltsmipn32.sh
+
+. ${srcdir}/emulparams/elf32bmipn32-defs.sh
+OUTPUT_FORMAT="elf32-ntradbigmips"
+BIG_OUTPUT_FORMAT="elf32-ntradbigmips"
+LITTLE_OUTPUT_FORMAT="elf32-ntradlittlemips"
+
+# Magic sections.
+OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
+OTHER_SECTIONS='
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
+'
+
+TEXT_DYNAMIC=
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32ebmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ebmip.sh
index 00ea8fd9c96..704b43ed575 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32ebmip.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ebmip.sh
@@ -1,28 +1,2 @@
-SCRIPT_NAME=elf
-OUTPUT_FORMAT="elf32-bigmips"
-BIG_OUTPUT_FORMAT="elf32-bigmips"
-LITTLE_OUTPUT_FORMAT="elf32-littlemips"
-TEXT_START_ADDR=0x0400000
-MAXPAGESIZE=0x40000
-NONPAGED_TEXT_START_ADDR=0x0400000
-SHLIB_TEXT_START_ADDR=0x5ffe0000
-OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
-OTHER_GOT_SYMBOLS='
- _gp = ALIGN(16) + 0x7ff0;
-'
-OTHER_GOT_SECTIONS='
- .lit8 : { *(.lit8) }
- .lit4 : { *(.lit4) }
-'
-TEXT_START_SYMBOLS='_ftext = . ;'
-DATA_START_SYMBOLS='_fdata = . ;'
-OTHER_BSS_SYMBOLS='_fbss = .;'
-OTHER_SECTIONS='
- .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
- .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
-'
-ARCH=mips
-MACHINE=
-TEMPLATE_NAME=elf32
-GENERATE_SHLIB_SCRIPT=yes
EMBEDDED=yes
+. ${srcdir}/emulparams/elf32bmip.sh
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32elmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32elmip.sh
index cf008c8f117..c94e503d604 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32elmip.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32elmip.sh
@@ -1,28 +1,2 @@
-SCRIPT_NAME=elf
-OUTPUT_FORMAT="elf32-littlemips"
-BIG_OUTPUT_FORMAT="elf32-bigmips"
-LITTLE_OUTPUT_FORMAT="elf32-littlemips"
-TEXT_START_ADDR=0x0400000
-MAXPAGESIZE=0x40000
-NONPAGED_TEXT_START_ADDR=0x0400000
-SHLIB_TEXT_START_ADDR=0x5ffe0000
-OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
-OTHER_GOT_SYMBOLS='
- _gp = ALIGN(16) + 0x7ff0;
-'
-OTHER_GOT_SECTIONS='
- .lit8 : { *(.lit8) }
- .lit4 : { *(.lit4) }
-'
-TEXT_START_SYMBOLS='_ftext = . ;'
-DATA_START_SYMBOLS='_fdata = . ;'
-OTHER_BSS_SYMBOLS='_fbss = .;'
-OTHER_SECTIONS='
- .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
- .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
-'
-ARCH=mips
-MACHINE=
-TEMPLATE_NAME=elf32
-GENERATE_SHLIB_SCRIPT=yes
EMBEDDED=yes
+. ${srcdir}/emulparams/elf32lmip.sh
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32fr30.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32fr30.sh
index 1be1f534b11..cec006c71f9 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32fr30.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32fr30.sh
@@ -6,5 +6,5 @@ ARCH=fr30
MAXPAGESIZE=256
ENTRY=_start
EMBEDDED=yes
-NOP=0x9fa0
-OTHER_RELOCATING_SECTIONS='PROVIDE (__stack = 0x200000);' \ No newline at end of file
+NOP=0x9fa09fa0
+OTHER_END_SYMBOLS='PROVIDE (__stack = 0x200000);'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32frv.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32frv.sh
new file mode 100755
index 00000000000..fd4be3e1847
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32frv.sh
@@ -0,0 +1,18 @@
+MACHINE=
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-frv"
+TEXT_START_ADDR=0x10000
+ARCH=frv
+MAXPAGESIZE=256
+ENTRY=_start
+EMBEDDED=yes
+OTHER_EXCLUDE_FILES='*frvend.o'
+OTHER_BSS_END_SYMBOLS='__end = .;'
+DATA_START_SYMBOLS='__data_start = . ;'
+STACK_ADDR=0x200000
+OTHER_GOT_SYMBOLS='
+ . = ALIGN(8); _gp = . + 2048;
+ PROVIDE (gp = _gp);'
+OTHER_READONLY_SECTIONS='
+ .rofixup : { *(.rofixup) }
+'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32ip2k.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ip2k.sh
new file mode 100644
index 00000000000..be2ce337c64
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ip2k.sh
@@ -0,0 +1,19 @@
+MACHINE=
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-ip2k"
+# See also `include/elf/ip2k.h'
+DATA_ADDR=0x01000100
+TEXT_START_ADDR=0x02010000
+GPR_START_ADDR=0x1000080
+GPR_SIZE=0x7F
+GRP_MEMORY=gpr
+ARCH=ip2k
+ENTRY=__start
+EMBEDDED=yes
+ELFSIZE=32
+MAXPAGESIZE=256
+WRITABLE_RODATA=
+OTHER_RELOCATING_SECTIONS='PROVIDE (__stack = 0x01000FFF);'
+OTHER_READONLY_SECTIONS='.pram 0x2000000 : { *(.pram) } .reset 0x201FFE0 : { *(.reset) }'
+OTHER_READWRITE_SECTIONS='.gpr 0x1000080 : { *(.gpr) }'
+
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32iq10.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32iq10.sh
new file mode 100755
index 00000000000..1721f5228d2
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32iq10.sh
@@ -0,0 +1,11 @@
+MACHINE=
+SCRIPT_NAME=iq2000
+OUTPUT_FORMAT="elf32-iq2000"
+DATA_ADDR=0x1000
+TEXT_START_ADDR=0x80000000
+ARCH=iq2000
+ENTRY=_start
+EMBEDDED=yes
+ELFSIZE=32
+MAXPAGESIZE=256
+OTHER_RELOCATING_SECTIONS='PROVIDE (__stack = 0x1800);'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32iq2000.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32iq2000.sh
new file mode 100755
index 00000000000..18f239da37d
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32iq2000.sh
@@ -0,0 +1,14 @@
+MACHINE=
+SCRIPT_NAME=iq2000
+OUTPUT_FORMAT="elf32-iq2000"
+DATA_ADDR=0x1000
+TEXT_START_ADDR=0x80000000
+ARCH=iq2000
+MAXPAGESIZE=256
+ENTRY=_start
+EMBEDDED=yes
+CTOR_START='__ctors = .;'
+CTOR_END='__ctors_end = .;'
+DTOR_START='__dtors = .;'
+DTOR_END='__dtors_end = .;'
+OTHER_RELOCATING_SECTIONS='PROVIDE (__stack = 0x1800);'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32lppcnto.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32lppcnto.sh
new file mode 100644
index 00000000000..1f1905542b2
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32lppcnto.sh
@@ -0,0 +1,5 @@
+. ${srcdir}/emulparams/elf32ppc.sh
+OUTPUT_FORMAT="elf32-powerpcle"
+MAXPAGESIZE=0x1000
+TEXT_START_ADDR=0x48040000
+
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32lppcsim.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32lppcsim.sh
index 74959f84136..e7438529431 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32lppcsim.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32lppcsim.sh
@@ -1,18 +1,2 @@
-TEMPLATE_NAME=elf32
-# If you change this, please also look at:
-# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh
-GENERATE_SHLIB_SCRIPT=yes
-SCRIPT_NAME=elf
-OUTPUT_FORMAT="elf32-powerpcle"
+. ${srcdir}/emulparams/elf32lppc.sh
TEXT_START_ADDR=0x10000000
-MAXPAGESIZE=0x10000
-ARCH=powerpc
-MACHINE=
-BSS_PLT=
-EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);'
-OTHER_BSS_END_SYMBOLS='__end = .;'
-OTHER_READWRITE_SECTIONS='
- .fixup : { *(.fixup) }
- .got1 : { *(.got1) }
- .got2 : { *(.got2) }
-'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32lsmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32lsmip.sh
index 4bdc8a10e69..62e4f98dcf0 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32lsmip.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32lsmip.sh
@@ -1,31 +1,2 @@
-SCRIPT_NAME=elf
-OUTPUT_FORMAT="elf32-littlemips"
-BIG_OUTPUT_FORMAT="elf32-bigmips"
-LITTLE_OUTPUT_FORMAT="elf32-littlemips"
-TEXT_START_ADDR=0x0400000
-DATA_ADDR=0x10000000
-MAXPAGESIZE=0x40000
-NONPAGED_TEXT_START_ADDR=0x0400000
-SHLIB_TEXT_START_ADDR=0x5ffe0000
-TEXT_DYNAMIC=
-INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
-OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
-OTHER_GOT_SYMBOLS='
- _gp = ALIGN(16) + 0x7ff0;
-'
-OTHER_GOT_SECTIONS='
- .lit8 : { *(.lit8) }
- .lit4 : { *(.lit4) }
-'
-TEXT_START_SYMBOLS='_ftext = . ;'
-DATA_START_SYMBOLS='_fdata = . ;'
-OTHER_BSS_SYMBOLS='_fbss = .;'
-OTHER_SECTIONS='
- .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
- .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
-'
-ARCH=mips
-MACHINE=
-TEMPLATE_NAME=elf32
-GENERATE_SHLIB_SCRIPT=yes
+. ${srcdir}/emulparams/elf32lmip.sh
ENTRY=__start
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32ltsmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ltsmip.sh
index 90d7d64e896..4a660f093ec 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32ltsmip.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ltsmip.sh
@@ -1,31 +1,2 @@
-SCRIPT_NAME=elf
+. ${srcdir}/emulparams/elf32btsmip.sh
OUTPUT_FORMAT="elf32-tradlittlemips"
-BIG_OUTPUT_FORMAT="elf32-tradbigmips"
-LITTLE_OUTPUT_FORMAT="elf32-tradlittlemips"
-TEXT_START_ADDR=0x0400000
-DATA_ADDR=0x10000000
-MAXPAGESIZE=0x40000
-NONPAGED_TEXT_START_ADDR=0x0400000
-SHLIB_TEXT_START_ADDR=0x0
-TEXT_DYNAMIC=
-INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
-OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
-OTHER_GOT_SYMBOLS='
- _gp = ALIGN(16) + 0x7ff0;
-'
-OTHER_GOT_SECTIONS='
- .lit8 : { *(.lit8) }
- .lit4 : { *(.lit4) }
-'
-TEXT_START_SYMBOLS='_ftext = . ;'
-DATA_START_SYMBOLS='_fdata = . ;'
-OTHER_BSS_SYMBOLS='_fbss = .;'
-OTHER_SECTIONS='
- .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
- .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
-'
-ARCH=mips
-MACHINE=
-TEMPLATE_NAME=elf32
-GENERATE_SHLIB_SCRIPT=yes
-ENTRY=__start
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32ltsmipn32.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ltsmipn32.sh
new file mode 100644
index 00000000000..276477d2cc6
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ltsmipn32.sh
@@ -0,0 +1,4 @@
+. ${srcdir}/emulparams/elf32btsmipn32.sh
+OUTPUT_FORMAT="elf32-ntradlittlemips"
+BIG_OUTPUT_FORMAT="elf32-ntradbigmips"
+LITTLE_OUTPUT_FORMAT="elf32-ntradlittlemips"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32mcore.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32mcore.sh
index 2d063873075..36befc8cb33 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32mcore.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32mcore.sh
@@ -19,14 +19,13 @@ EMBEDDED=yes
# explicitly set first, and since the NOP code is only used as a
# fill value between independantly viable peices of code, it should
# not matter.
-NOP=0x0e0e
+NOP=0x0e0e0e0e
OTHER_BSS_SYMBOLS="__bss_start__ = . ;"
OTHER_BSS_END_SYMBOLS="__bss_end__ = . ;"
-# Hmmm, there's got to be a better way. This sets the stack to the
-# top of the simulator memory (2^19 bytes).
-OTHER_RELOCATING_SECTIONS='.stack 0x80000 : { _stack = .; *(.stack) }'
+# This sets the stack to the top of the simulator memory (2^19 bytes).
+STACK_ADDR=0x80000
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32openrisc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32openrisc.sh
new file mode 100755
index 00000000000..a65dcd89c57
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32openrisc.sh
@@ -0,0 +1,10 @@
+MACHINE=
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-openrisc"
+TEXT_START_ADDR=0x10000
+ARCH=openrisc
+MAXPAGESIZE=0x1000
+ENTRY=_start
+EMBEDDED=yes
+NOP=0x15000000
+
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32ppc_fbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ppc_fbsd.sh
new file mode 100644
index 00000000000..2bac85c738e
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ppc_fbsd.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/elf32ppc.sh
+. ${srcdir}/emulparams/elf_fbsd.sh
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32ppclinux.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ppclinux.sh
index 7c458a22ca3..5ced00d1bec 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32ppclinux.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ppclinux.sh
@@ -1,18 +1,8 @@
-TEMPLATE_NAME=elf32
-# If you change this, please also look at:
-# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh
-GENERATE_SHLIB_SCRIPT=yes
-SCRIPT_NAME=elf
-OUTPUT_FORMAT="elf32-powerpc"
+. ${srcdir}/emulparams/elf32ppc.sh
TEXT_START_ADDR=0x10000000
-MAXPAGESIZE=0x10000
-ARCH=powerpc
-MACHINE=
-BSS_PLT=
-OTHER_RELOCATING_SECTIONS='
- /DISCARD/ : { *(.fixup) }
-'
-OTHER_READWRITE_SECTIONS='
- .got1 : { *(.got1) }
- .got2 : { *(.got2) }
-'
+unset EXECUTABLE_SYMBOLS
+unset OTHER_BSS_END_SYMBOLS
+test -z "${RELOCATING}" || OTHER_SECTIONS="/DISCARD/ : { *(.fixup) }"
+OTHER_READWRITE_SECTIONS="
+ .got1 ${RELOCATING-0} : { *(.got1) }
+ .got2 ${RELOCATING-0} : { *(.got2) }"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32ppcnto.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ppcnto.sh
new file mode 100644
index 00000000000..dd4a79cb91a
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ppcnto.sh
@@ -0,0 +1,4 @@
+. ${srcdir}/emulparams/elf32ppc.sh
+MAXPAGESIZE=0x1000
+TEXT_START_ADDR=0x48040000
+
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32ppcsim.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ppcsim.sh
index e25a170dbed..c3466cfaf17 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32ppcsim.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ppcsim.sh
@@ -1,18 +1,2 @@
-TEMPLATE_NAME=elf32
-# If you change this, please also look at:
-# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh
-GENERATE_SHLIB_SCRIPT=yes
-SCRIPT_NAME=elf
-OUTPUT_FORMAT="elf32-powerpc"
+. ${srcdir}/emulparams/elf32ppc.sh
TEXT_START_ADDR=0x10000000
-MAXPAGESIZE=0x10000
-ARCH=powerpc
-MACHINE=
-BSS_PLT=
-EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);'
-OTHER_BSS_END_SYMBOLS='__end = .;'
-OTHER_READWRITE_SECTIONS='
- .fixup : { *(.fixup) }
- .got1 : { *(.got1) }
- .got2 : { *(.got2) }
-'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32ppcwindiss.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ppcwindiss.sh
new file mode 100644
index 00000000000..c0e6138c29f
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ppcwindiss.sh
@@ -0,0 +1,23 @@
+TEMPLATE_NAME=elf32
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-powerpc"
+ARCH=powerpc
+MACHINE=
+EMBEDDED=yes
+MAXPAGESIZE=0x10000
+
+# The data below is taken from the windiss.dld linker script that comes with
+# the Diab linker.
+TEXT_START_ADDR=0x100000
+DATA_START_SYMBOLS='__DATA_ROM = .; __DATA_RAM = .;'
+EXECUTABLE_SYMBOLS='__HEAP_START = .; __SP_INIT = 0x800000; __SP_END = __SP_INIT - 0x20000; __HEAP_END = __SP_END; __DATA_END = _edata; __BSS_START = __bss_start; __BSS_END = _end; __HEAP_START = _end;'
+
+# The Diab tools use a different init/fini convention. Initialization code
+# is place in sections named ".init$NN". These sections are then concatenated
+# into the .init section. It is important that .init$00 be first and .init$99
+# be last. The other sections should be sorted, but the current linker script
+# parse does not seem to allow that with the SORT keyword in this context.
+INIT_START='*(.init$00); *(.init$0[1-9]); *(.init$[1-8][0-9]); *(.init$9[0-8])'
+INIT_END='*(.init$99)'
+FINI_START='*(.fini$00); *(.fini$0[1-9]); *(.fini$[1-8][0-9]); *(.fini$9[0-8])'
+FINI_END='*(.fini$99)'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32vax.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32vax.sh
new file mode 100644
index 00000000000..56bbab7deb3
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32vax.sh
@@ -0,0 +1,11 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-vax"
+TEXT_START_ADDR=0x10000
+MAXPAGESIZE=0x10000
+NONPAGED_TEXT_START_ADDR=0x1000
+ARCH=vax
+MACHINE=
+NOP=0x0101
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+NO_SMALL_DATA=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32xstormy16.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32xstormy16.sh
new file mode 100644
index 00000000000..a512ec36901
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32xstormy16.sh
@@ -0,0 +1,13 @@
+MACHINE=
+SCRIPT_NAME=xstormy16
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=needrelax
+OUTPUT_FORMAT="elf32-xstormy16"
+# See also `include/elf/xstormy16.h'
+ARCH=xstormy16
+ALIGNMENT=2
+ENTRY=_start
+EMBEDDED=yes
+NOP=0
+
+
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32xtensa.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32xtensa.sh
new file mode 100644
index 00000000000..12e28820b3f
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32xtensa.sh
@@ -0,0 +1,32 @@
+# First set some configuration-specific variables
+. ${srcdir}/emulparams/xtensa-config.sh
+
+# See genscripts.sh and ../scripttempl/elfxtensa.sc for the meaning of these.
+SCRIPT_NAME=elfxtensa
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=xtensaelf
+OUTPUT_FORMAT=undefined
+BIG_OUTPUT_FORMAT="elf32-xtensa-be"
+LITTLE_OUTPUT_FORMAT="elf32-xtensa-le"
+TEXT_START_ADDR=0x400000
+NONPAGED_TEXT_START_ADDR=0x400000
+ARCH=xtensa
+MACHINE=
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_COMBRELOC_SCRIPT=yes
+NO_SMALL_DATA=yes
+OTHER_READONLY_SECTIONS='
+ .xt_except_table : { KEEP (*(.xt_except_table)) }
+ .xt.lit : { *(.xt.lit*) *(.gnu.linkonce.p*) }
+'
+OTHER_READWRITE_SECTIONS='
+ .xt_except_desc :
+ {
+ *(.xt_except_desc)
+ *(.gnu.linkonce.h.*)
+ *(.xt_except_desc_end)
+ }
+'
+OTHER_SECTIONS='
+ .xt.insn : { *(.xt.insn) *(.gnu.linkonce.x*) }
+'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64_aix.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64_aix.sh
new file mode 100644
index 00000000000..738fea94ff0
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64_aix.sh
@@ -0,0 +1,21 @@
+# See genscripts.sh and ../scripttempl/elf.sc for the meaning of these.
+SCRIPT_NAME=elf
+ELFSIZE=64
+TEMPLATE_NAME=elf32
+OUTPUT_FORMAT="elf64-ia64-aix-little"
+ARCH=ia64
+MACHINE=
+MAXPAGESIZE=0x10000
+TEXT_START_ADDR="0x10000000"
+DATA_ADDR="ALIGN (0x10000000) + (. & (${MAXPAGESIZE} - 1))"
+GENERATE_SHLIB_SCRIPT=yes
+NOP=0x00300000010070000002000001000400 # a bundle full of nops
+OTHER_GOT_SECTIONS="
+ .IA_64.pltoff ${RELOCATING-0} : { *(.IA_64.pltoff) }"
+OTHER_PLT_RELOC_SECTIONS="
+ .rela.IA_64.pltoff ${RELOCATING-0} : { *(.rela.IA_64.pltoff) }"
+OTHER_READONLY_SECTIONS="
+ .opd ${RELOCATING-0} : { *(.opd) }
+ .IA_64.unwind_info ${RELOCATING-0} : { *(.IA_64.unwind_info*${RELOCATING+ .gnu.linkonce.ia64unwi.*}) }
+ .IA_64.unwind ${RELOCATING-0} : { *(.IA_64.unwind*${RELOCATING+ .gnu.linkonce.ia64unw.*}) }"
+LIB_PATH="=/usr/lib/ia64l64:=/usr/lib:=/usr/local/lib"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64_ia64.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64_ia64.sh
index fff59924cb3..817c50adad5 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf64_ia64.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64_ia64.sh
@@ -2,14 +2,26 @@
SCRIPT_NAME=elf
ELFSIZE=64
TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=needrelax
OUTPUT_FORMAT="elf64-ia64-little"
ARCH=ia64
MACHINE=
MAXPAGESIZE=0x10000
+# FIXME: It interferes with linker relaxation. Disable it until it is
+# fixed.
+if test "0" = "1" -a -n "$CREATE_SHLIB"; then
+ # Optimize shared libraries for 16K page size
+ COMMONPAGESIZE=0x4000
+fi
TEXT_START_ADDR="0x4000000000000000"
DATA_ADDR="0x6000000000000000 + (. & (${MAXPAGESIZE} - 1))"
GENERATE_SHLIB_SCRIPT=yes
NOP=0x00300000010070000002000001000400 # a bundle full of nops
-OTHER_GOT_SECTIONS='.IA_64.pltoff : { *(.IA_64.pltoff) }'
-OTHER_PLT_RELOC_SECTIONS='.rela.IA_64.pltoff : { *(.rela.IA_64.pltoff) }'
-OTHER_READONLY_SECTIONS='.opd : { *(.opd) } .IA_64.unwind_info : { *(.IA_64.unwind_info*) } .IA_64.unwind : { *(.IA_64.unwind*) }'
+OTHER_GOT_SECTIONS="
+ .IA_64.pltoff ${RELOCATING-0} : { *(.IA_64.pltoff) }"
+OTHER_PLT_RELOC_SECTIONS="
+ .rela.IA_64.pltoff ${RELOCATING-0} : { *(.rela.IA_64.pltoff) }"
+OTHER_READONLY_SECTIONS="
+ .opd ${RELOCATING-0} : { *(.opd) }
+ .IA_64.unwind_info ${RELOCATING-0} : { *(.IA_64.unwind_info${RELOCATING+* .gnu.linkonce.ia64unwi.*}) }
+ .IA_64.unwind ${RELOCATING-0} : { *(.IA_64.unwind${RELOCATING+* .gnu.linkonce.ia64unw.*}) }"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64_ia64_fbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64_ia64_fbsd.sh
new file mode 100644
index 00000000000..d9c9600482b
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64_ia64_fbsd.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/elf64_ia64.sh
+. ${srcdir}/emulparams/elf_fbsd.sh
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64_s390.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64_s390.sh
new file mode 100644
index 00000000000..e441b8ac4db
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64_s390.sh
@@ -0,0 +1,32 @@
+SCRIPT_NAME=elf
+ELFSIZE=64
+OUTPUT_FORMAT="elf64-s390"
+TEXT_START_ADDR=0x80000000
+MAXPAGESIZE=0x1000
+NONPAGED_TEXT_START_ADDR=0x80000000
+ARCH="s390:64-bit"
+MACHINE=
+NOP=0x07070707
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+
+# Treat a host that matches the target with the possible exception of "x"
+# in the name as if it were native.
+if test `echo "$host" | sed -e s/390x/390/` \
+ = `echo "$target" | sed -e s/390x/390/`; then
+ case " $EMULATION_LIBPATH " in
+ *" ${EMULATION_NAME} "*)
+ NATIVE=yes
+ esac
+fi
+
+# Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first
+# on Linux.
+case "$target" in
+ s390*-linux*)
+ case "$EMULATION_NAME" in
+ *64*)
+ LIBPATH_SUFFIX=64 ;;
+ esac
+ ;;
+esac
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc_fbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc_fbsd.sh
new file mode 100644
index 00000000000..232a32143b0
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc_fbsd.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/elf64_sparc.sh
+. ${srcdir}/emulparams/elf_fbsd.sh
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64alpha_fbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64alpha_fbsd.sh
new file mode 100644
index 00000000000..fd4a0a41eb4
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64alpha_fbsd.sh
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/elf64alpha.sh
+. ${srcdir}/emulparams/elf_fbsd.sh
+OUTPUT_FORMAT="elf64-alpha-freebsd"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64alpha_nbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64alpha_nbsd.sh
new file mode 100644
index 00000000000..8116f48b7cc
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64alpha_nbsd.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/elf64alpha.sh
+ENTRY=__start
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64bmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64bmip.sh
index a4852d53cf4..7078a788af9 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf64bmip.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64bmip.sh
@@ -1,35 +1,8 @@
-# This is an ELF platform.
-SCRIPT_NAME=elf
-
-# Handle both big- and little-ended 32-bit MIPS objects.
-ARCH=mips
+. ${srcdir}/emulparams/elf32bmipn32-defs.sh
OUTPUT_FORMAT="elf64-bigmips"
BIG_OUTPUT_FORMAT="elf64-bigmips"
LITTLE_OUTPUT_FORMAT="elf64-littlemips"
-# Note that the elf32 template is used for 64-bit emulations as well
-# as 32-bit emulations.
-ELFSIZE=64
-TEMPLATE_NAME=elf32
-
-TEXT_START_ADDR=0x10000000
-MAXPAGESIZE=0x100000
-ENTRY=__start
-
-# GOT-related settings.
-OTHER_GOT_SYMBOLS='
- _gp = ALIGN(16) + 0x7ff0;
-'
-OTHER_GOT_SECTIONS='
- .lit8 : { *(.lit8) }
- .lit4 : { *(.lit4) }
- .srdata : { *(.srdata) }
-'
-
-# Magic symbols.
-TEXT_START_SYMBOLS='_ftext = . ;'
-DATA_START_SYMBOLS='_fdata = . ;'
-OTHER_BSS_SYMBOLS='_fbss = .;'
# IRIX6 defines these symbols. 0x40 is the size of the ELF header.
EXECUTABLE_SYMBOLS="
__dso_displacement = 0;
@@ -43,37 +16,3 @@ EXECUTABLE_SYMBOLS="
# Following the IRIX linker, we simply put .rodata in the data
# segment.
WRITABLE_RODATA=
-
-
-OTHER_RELOCATING_SECTIONS='
- .MIPS.events.text :
- {
- *(.MIPS.events.text)
- *(.MIPS.events.gnu.linkonce.t*)
- }
- .MIPS.content.text :
- {
- *(.MIPS.content.text)
- *(.MIPS.content.gnu.linkonce.t*)
- }
- .MIPS.events.data :
- {
- *(.MIPS.events.data)
- *(.MIPS.events.gnu.linkonce.d*)
- }
- .MIPS.content.data :
- {
- *(.MIPS.content.data)
- *(.MIPS.content.gnu.linkonce.d*)
- }
- .MIPS.events.rodata :
- {
- *(.MIPS.events.rodata)
- *(.MIPS.events.gnu.linkonce.r*)
- }
- .MIPS.content.rodata :
- {
- *(.MIPS.content.rodata)
- *(.MIPS.content.gnu.linkonce.r*)
- }
-'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64btsmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64btsmip.sh
index f3d917cfb76..c4595ced90a 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf64btsmip.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64btsmip.sh
@@ -1,44 +1,17 @@
-# This is an ELF platform.
-SCRIPT_NAME=elf
+# If you change this file, please also look at files which source this one:
+# elf64ltsmip.sh
-# Handle both big- and little-ended 64-bit MIPS objects.
-ARCH=mips
+. ${srcdir}/emulparams/elf32bmipn32-defs.sh
OUTPUT_FORMAT="elf64-tradbigmips"
BIG_OUTPUT_FORMAT="elf64-tradbigmips"
LITTLE_OUTPUT_FORMAT="elf64-tradlittlemips"
-# Note that the elf32 template is used for 64-bit emulations as well
-# as 32-bit emulations.
-ELFSIZE=64
-TEMPLATE_NAME=elf32
-GENERATE_SHLIB_SCRIPT=yes
-
-TEXT_START_ADDR=0x10000000
-DATA_ADDR=0x0400000000
-MAXPAGESIZE=0x100000
-NONPAGED_TEXT_START_ADDR=0x10000000
-SHLIB_TEXT_START_ADDR=0x0
-TEXT_DYNAMIC=
-ENTRY=__start
-
-# GOT-related settings.
-OTHER_GOT_SYMBOLS='
- _gp = ALIGN(16) + 0x7ff0;
-'
-OTHER_GOT_SECTIONS='
- .lit8 : { *(.lit8) }
- .lit4 : { *(.lit4) }
-'
-
-# Magic symbols.
-TEXT_START_SYMBOLS='_ftext = . ;'
-DATA_START_SYMBOLS='_fdata = . ;'
-OTHER_BSS_SYMBOLS='_fbss = .;'
-
# Magic sections.
-INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
+INITIAL_READONLY_SECTIONS='.MIPS.options : { *(.MIPS.options) }'
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
OTHER_SECTIONS='
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
'
+
+TEXT_DYNAMIC=
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64hppa.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64hppa.sh
index 829ad43345c..26c3153f069 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf64hppa.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64hppa.sh
@@ -1,9 +1,10 @@
-SCRIPT_NAME=elf
-ELFSIZE=64
+. ${srcdir}/emulparams/hppa64linux.sh
OUTPUT_FORMAT="elf64-hppa"
-LIB_PATH=/usr/lib/pa20_64:/opt/langtools/lib/pa20_64
+LIB_PATH="=/usr/lib/pa20_64:=/opt/langtools/lib/pa20_64"
TEXT_START_ADDR=0x4000000000001000
DATA_ADDR=0x8000000000001000
+TARGET_PAGE_SIZE=4096
+MAXPAGESIZE=4096
# The HP dynamic linker actually requires you set the start of text and
# data to some reasonable value. Of course nobody knows what reasoanble
@@ -11,43 +12,8 @@ DATA_ADDR=0x8000000000001000
SHLIB_TEXT_START_ADDR=0x4000000000001000
SHLIB_DATA_ADDR=0x8000000000001000
-TARGET_PAGE_SIZE=4096
-MAXPAGESIZE=4096
-ARCH=hppa
-MACHINE=hppa2.0w
-ENTRY="main"
-TEMPLATE_NAME=elf32
-GENERATE_SHLIB_SCRIPT=yes
-# We really want multiple .stub sections, one for each input .text section,
-# but for now this is good enough.
-OTHER_READONLY_SECTIONS='.PARISC.unwind : { *(.PARISC.unwind) } '
-
-# The PA64 ELF port treats .plt sections differently than most. We also have
-# to create a .opd section. What most systems call the .got, we call the .dlt
-OTHER_READWRITE_SECTIONS='.opd : { *(.opd) } PROVIDE (__gp = .); .plt : { *(.plt) } .dlt : { *(.dlt) }'
-
-# The PA64 ELF port has two additional bss sections. huge bss and thread bss.
-# Make sure they end up in the appropriate location. We also have to set
-# __TLS_SIZE to the size of the thread bss section.
-OTHER_BSS_SECTIONS='.hbss : { *(.hbss) } .tbss : { *(.tbss) }'
-#OTHER_BSS_END_SYMBOLS='PROVIDE (__TLS_SIZE = SIZEOF (.tbss));'
-OTHER_BSS_END_SYMBOLS='PROVIDE (__TLS_SIZE = 0);'
-
-# HPs use .dlt where systems use .got. Sigh.
-OTHER_GOT_RELOC_SECTIONS='.rela.dlt : { *(.rela.dlt) }'
-
-# We're not actually providing a symbol anymore (due to the inability to be
-# safe in regards to shared libraries). So we just allocate the hunk of space
-# unconditionally, but do not mess around with the symbol table.
-DATA_START_SYMBOLS='. += 16;'
-
# The linker is required to define these two symbols.
EXECUTABLE_SYMBOLS='PROVIDE (__SYSTEM_ID = 0x214); PROVIDE (_FPU_STATUS = 0x0);'
-DATA_PLT=
-
-# .dynamic should be at the start of the .text segment.
-TEXT_DYNAMIC=
-
# The PA64 ELF port needs two additional initializer sections and also wants
# a start/end symbol pair for the .init and .fini sections.
INIT_START='KEEP (*(.HP.init)); PROVIDE (__preinit_start = .); KEEP (*(.preinit)); PROVIDE (__preinit_end = .); PROVIDE (__init_start = .);'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64lppc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64lppc.sh
new file mode 100644
index 00000000000..1c474935eb4
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64lppc.sh
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/elf64ppc.sh
+OUTPUT_FORMAT="elf64-powerpcle"
+NOP=0x00000060
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64ltsmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64ltsmip.sh
index ac2dcfc76b4..efd6b7d8d6e 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf64ltsmip.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64ltsmip.sh
@@ -1,44 +1,4 @@
-# This is an ELF platform.
-SCRIPT_NAME=elf
-
-# Handle both big- and little-ended 64-bit MIPS objects.
-ARCH=mips
+. ${srcdir}/emulparams/elf64btsmip.sh
OUTPUT_FORMAT="elf64-tradlittlemips"
BIG_OUTPUT_FORMAT="elf64-tradbigmips"
LITTLE_OUTPUT_FORMAT="elf64-tradlittlemips"
-
-# Note that the elf32 template is used for 64-bit emulations as well
-# as 32-bit emulations.
-ELFSIZE=64
-TEMPLATE_NAME=elf32
-GENERATE_SHLIB_SCRIPT=yes
-
-TEXT_START_ADDR=0x10000000
-DATA_ADDR=0x0400000000
-MAXPAGESIZE=0x100000
-NONPAGED_TEXT_START_ADDR=0x10000000
-SHLIB_TEXT_START_ADDR=0x0
-TEXT_DYNAMIC=
-ENTRY=__start
-
-# GOT-related settings.
-OTHER_GOT_SYMBOLS='
- _gp = ALIGN(16) + 0x7ff0;
-'
-OTHER_GOT_SECTIONS='
- .lit8 : { *(.lit8) }
- .lit4 : { *(.lit4) }
-'
-
-# Magic symbols.
-TEXT_START_SYMBOLS='_ftext = . ;'
-DATA_START_SYMBOLS='_fdata = . ;'
-OTHER_BSS_SYMBOLS='_fbss = .;'
-
-# Magic sections.
-INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
-OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
-OTHER_SECTIONS='
- .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
- .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
-'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64mmix.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64mmix.sh
new file mode 100644
index 00000000000..1ee92832891
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64mmix.sh
@@ -0,0 +1,61 @@
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+ELFSIZE=64
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf64-mmix"
+ENTRY=_start.
+
+# Default to 0 as mmixal does.
+TEXT_START_ADDR='DEFINED (__.MMIX.start..text) ? __.MMIX.start..text : 0'
+# Don't add SIZEOF_HEADERS.
+# Don't set EMBEDDED, that would be misleading; it's not that kind of system.
+TEXT_BASE_ADDRESS=$TEXT_START_ADDR
+DATA_ADDR='DEFINED (__.MMIX.start..data) ? __.MMIX.start..data : 0x2000000000000000'
+
+# Setting this anywhere near the quite reasonable value of 0x10000
+# causes the binary to bloat to reach page alignment between segments.
+# Let's just have a 256-byte default page alignment. Having some
+# alignment at all gives a warm feeling but not much more.
+MAXPAGESIZE=256
+ARCH=mmix
+MACHINE=
+COMPILE_IN=yes
+EXTRA_EM_FILE=mmixelf
+
+# The existence of a symbol __start (or _start) should overrule Main, so
+# it can be a user symbol without the associated mmixal magic. We
+# also want to provide Main as a synonym for _start, if Main wasn't
+# defined but is referred to, and _start was defined.
+#
+# The reason we use a symbol "_start." as a mediator is to avoid
+# causing ld to force the type of _start to object rather than no
+# type, which confuses disassembly; we also make it alphanumerically
+# a successor of _start for similar reasons. Perhaps it's a linker
+# bug that linker-defined symbols set the symbol-type.
+#
+# Note that we smuggle this into OTHER_TEXT_SECTIONS (at the end
+# of .text) rather than TEXT_START_SYMBOLS. This is necessary, as
+# DEFINED wouldn't find the symbol if it was at the top; presumably
+# before the definition, if the definition is not in the first file.
+# FIXME: Arguably a linker bug.
+OTHER_TEXT_SECTIONS='
+ _start. = (DEFINED (_start) ? _start
+ : (DEFINED (Main) ? Main : (DEFINED (.text) ? .text : 0)));
+ PROVIDE (Main = DEFINED (Main) ? Main : (DEFINED (_start) ? _start : _start.));
+'
+
+OTHER_SECTIONS='
+ .MMIX.reg_contents :
+ {
+ /* Note that this section always has a fixed VMA - that of its
+ first register * 8. */
+ *(.MMIX.reg_contents.linker_allocated);
+ *(.MMIX.reg_contents);
+ }
+'
+
+# FIXME: Also bit by the PROVIDE bug? If not, this could be
+# EXECUTABLE_SYMBOLS.
+# By default, put the high end of the stack where the register stack
+# begins. They grow in opposite directions. */
+OTHER_END_SYMBOLS="PROVIDE (__Stack_start = 0x6000000000000000);"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64ppc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64ppc.sh
new file mode 100644
index 00000000000..300b8d4b543
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64ppc.sh
@@ -0,0 +1,47 @@
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=ppc64elf
+ELFSIZE=64
+GENERATE_SHLIB_SCRIPT=yes
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf64-powerpc"
+TEXT_START_ADDR=0x10000000
+#SEGMENT_SIZE=0x10000000
+MAXPAGESIZE=0x10000
+COMMONPAGESIZE=0x1000
+ARCH=powerpc:common64
+MACHINE=
+NOP=0x60000000
+EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);'
+OTHER_BSS_END_SYMBOLS='__end = .;'
+CTOR_START='PROVIDE (__CTOR_LIST__ = .); PROVIDE (___CTOR_LIST__ = .);'
+CTOR_END='PROVIDE (__CTOR_END__ = .); PROVIDE (___CTOR_END__ = .);'
+DTOR_START='PROVIDE (__DTOR_LIST__ = .); PROVIDE (___DTOR_LIST__ = .);'
+DTOR_END='PROVIDE (__DTOR_END__ = .); PROVIDE (___DTOR_END__ = .);'
+OTHER_TEXT_SECTIONS="*(.sfpr .glink)"
+BSS_PLT=
+OTHER_BSS_SYMBOLS="
+ .tocbss ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.tocbss)}"
+OTHER_PLT_RELOC_SECTIONS="
+ .rela.tocbss ${RELOCATING-0} : { *(.rela.tocbss) }"
+OTHER_GOT_SECTIONS="
+ .toc ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.toc) }"
+OTHER_GOT_RELOC_SECTIONS="
+ .rela.toc ${RELOCATING-0} : { *(.rela.toc) }"
+OTHER_READWRITE_SECTIONS="
+ .toc1 ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { *(.toc1) }
+ .opd ${RELOCATING-0}${RELOCATING+ALIGN(8)} : { KEEP (*(.opd)) }"
+
+# Treat a host that matches the target with the possible exception of "64"
+# in the name as if it were native.
+if test `echo "$host" | sed -e s/64//` = `echo "$target" | sed -e s/64//`; then
+ case " $EMULATION_LIBPATH " in
+ *" ${EMULATION_NAME} "*)
+ NATIVE=yes
+ ;;
+ esac
+fi
+
+# Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first.
+case "$EMULATION_NAME" in
+ *64*) LIBPATH_SUFFIX=64 ;;
+esac
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_fbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_fbsd.sh
new file mode 100644
index 00000000000..2ea646e9530
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf_fbsd.sh
@@ -0,0 +1 @@
+ELF_INTERPRETER_NAME=\"/usr/libexec/ld-elf.so.1\"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_i386_be.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_i386_be.sh
index 9977a069a4a..2c681b763af 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf_i386_be.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf_i386_be.sh
@@ -6,6 +6,7 @@ NONPAGED_TEXT_START_ADDR=0x80000000
MAXPAGESIZE=0x1000
ARCH=i386
MACHINE=
-NOP=0x9090
+NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
+NO_SMALL_DATA=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_i386_chaos.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_i386_chaos.sh
index 32e7719de6c..e018231f043 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf_i386_chaos.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf_i386_chaos.sh
@@ -1,10 +1,11 @@
-SCRIPT_NAME=elf
+SCRIPT_NAME=elf_chaos
OUTPUT_FORMAT="elf32-i386"
TEXT_START_ADDR=0x40000000
MAXPAGESIZE=0x1000
NONPAGED_TEXT_START_ADDR=0x40000000
ARCH=i386
MACHINE=
-NOP=0x9090
+NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
+NO_SMALL_DATA=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_i386_fbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_i386_fbsd.sh
new file mode 100644
index 00000000000..23785983ff8
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf_i386_fbsd.sh
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/elf_i386.sh
+. ${srcdir}/emulparams/elf_fbsd.sh
+OUTPUT_FORMAT="elf32-i386-freebsd"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_i386_ldso.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_i386_ldso.sh
new file mode 100644
index 00000000000..a477a693286
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf_i386_ldso.sh
@@ -0,0 +1,12 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-i386"
+TEXT_START_ADDR=0x08048000
+MAXPAGESIZE=0x1000
+NONPAGED_TEXT_START_ADDR=0x08048000
+ARCH=i386
+MACHINE=
+NOP=0x90909090
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+ELF_INTERPRETER_NAME=\"/usr/lib/ld.so.1\"
+NO_SMALL_DATA=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_s390.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_s390.sh
new file mode 100644
index 00000000000..2804aceeb9b
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf_s390.sh
@@ -0,0 +1,10 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-s390"
+TEXT_START_ADDR=0x00400000
+MAXPAGESIZE=0x1000
+NONPAGED_TEXT_START_ADDR=0x00400000
+ARCH="s390:31-bit"
+MACHINE=
+NOP=0x07070707
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64_fbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64_fbsd.sh
new file mode 100644
index 00000000000..34258cb9289
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64_fbsd.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/elf_x86_64.sh
+. ${srcdir}/emulparams/elf_fbsd.sh
diff --git a/gnu/usr.bin/binutils/ld/emulparams/h8300elf.sh b/gnu/usr.bin/binutils/ld/emulparams/h8300elf.sh
new file mode 100644
index 00000000000..0617d5b1cca
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/h8300elf.sh
@@ -0,0 +1,12 @@
+# If you change this file, please also look at files which source this one:
+# h8300helf.sh h8300self.sh
+
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-h8300"
+TEXT_START_ADDR=0x100
+MAXPAGESIZE=2
+TARGET_PAGE_SIZE=128
+ARCH=h8300
+TEMPLATE_NAME=elf32
+EMBEDDED=yes
+STACK_ADDR=0xfefc
diff --git a/gnu/usr.bin/binutils/ld/emulparams/h8300helf.sh b/gnu/usr.bin/binutils/ld/emulparams/h8300helf.sh
new file mode 100644
index 00000000000..1cde35cf125
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/h8300helf.sh
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/h8300elf.sh
+ARCH="h8300:h8300h"
+STACK_ADDR=0x2fefc
diff --git a/gnu/usr.bin/binutils/ld/emulparams/h8300hn.sh b/gnu/usr.bin/binutils/ld/emulparams/h8300hn.sh
new file mode 100644
index 00000000000..d349082336c
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/h8300hn.sh
@@ -0,0 +1,5 @@
+SCRIPT_NAME=h8300hn
+OUTPUT_FORMAT="coff-h8300"
+TEXT_START_ADDR=0x8000
+TARGET_PAGE_SIZE=128
+ARCH=h8300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/h8300hnelf.sh b/gnu/usr.bin/binutils/ld/emulparams/h8300hnelf.sh
new file mode 100644
index 00000000000..4a75ff9f81a
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/h8300hnelf.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/h8300elf.sh
+ARCH="h8300:h8300hn"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/h8300self.sh b/gnu/usr.bin/binutils/ld/emulparams/h8300self.sh
new file mode 100644
index 00000000000..7539eecf541
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/h8300self.sh
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/h8300elf.sh
+ARCH="h8300:h8300s"
+STACK_ADDR=0x2fefc
diff --git a/gnu/usr.bin/binutils/ld/emulparams/h8300sn.sh b/gnu/usr.bin/binutils/ld/emulparams/h8300sn.sh
new file mode 100644
index 00000000000..16364efab0b
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/h8300sn.sh
@@ -0,0 +1,5 @@
+SCRIPT_NAME=h8300sn
+OUTPUT_FORMAT="coff-h8300"
+TEXT_START_ADDR=0x8000
+TARGET_PAGE_SIZE=128
+ARCH=h8300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/h8300snelf.sh b/gnu/usr.bin/binutils/ld/emulparams/h8300snelf.sh
new file mode 100644
index 00000000000..ddeec116856
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/h8300snelf.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/h8300elf.sh
+ARCH="h8300:h8300sn"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/hppa64linux.sh b/gnu/usr.bin/binutils/ld/emulparams/hppa64linux.sh
new file mode 100644
index 00000000000..6e01c20b08e
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/hppa64linux.sh
@@ -0,0 +1,58 @@
+# If you change this file, please also look at files which source this one:
+# elf64hppa.sh
+
+SCRIPT_NAME=elf
+ELFSIZE=64
+# FIXME: this output format is for hpux.
+OUTPUT_FORMAT="elf64-hppa-linux"
+TEXT_START_ADDR=0x10000
+TARGET_PAGE_SIZE=0x10000
+MAXPAGESIZE=0x10000
+ARCH=hppa
+MACHINE=hppa2.0w
+ENTRY="main"
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+
+# We really want multiple .stub sections, one for each input .text section,
+# but for now this is good enough.
+OTHER_READONLY_SECTIONS="
+ .PARISC.unwind ${RELOCATING-0} : { *(.PARISC.unwind) }"
+
+# The PA64 ELF port treats .plt sections differently than most. We also have
+# to create a .opd section. What most systems call the .got, we call the .dlt
+OTHER_READWRITE_SECTIONS="
+ .opd ${RELOCATING-0} : { *(.opd) }
+ ${RELOCATING+PROVIDE (__gp = .);}
+ .plt ${RELOCATING-0} : { *(.plt) }
+ .dlt ${RELOCATING-0} : { *(.dlt) }"
+
+# The PA64 ELF port has two additional bss sections. huge bss and thread bss.
+# Make sure they end up in the appropriate location. We also have to set
+# __TLS_SIZE to the size of the thread bss section.
+OTHER_BSS_SECTIONS="
+ .hbss ${RELOCATING-0} : { *(.hbss) }
+ .tbss ${RELOCATING-0} : { *(.tbss) }
+"
+#OTHER_BSS_END_SYMBOLS='PROVIDE (__TLS_SIZE = SIZEOF (.tbss));'
+OTHER_BSS_END_SYMBOLS='
+ PROVIDE (__TLS_SIZE = 0);
+ PROVIDE (__TLS_INIT_SIZE = 0);
+ PROVIDE (__TLS_INIT_START = 0);
+ PROVIDE (__TLS_INIT_A = 0);
+ PROVIDE (__TLS_PREALLOC_DTV_A = 0);'
+
+# HPs use .dlt where systems use .got. Sigh.
+OTHER_GOT_RELOC_SECTIONS="
+ .rela.dlt ${RELOCATING-0} : { *(.rela.dlt) }
+ .rela.opd ${RELOCATING-0} : { *(.rela.opd) }"
+
+# We're not actually providing a symbol anymore (due to the inability to be
+# safe in regards to shared libraries). So we just allocate the hunk of space
+# unconditionally, but do not mess around with the symbol table.
+DATA_START_SYMBOLS='. += 16;'
+
+DATA_PLT=
+
+# .dynamic should be at the start of the .text segment.
+TEXT_DYNAMIC=
diff --git a/gnu/usr.bin/binutils/ld/emulparams/hppalinux.sh b/gnu/usr.bin/binutils/ld/emulparams/hppalinux.sh
index 0a982984d01..08309b3dbf4 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/hppalinux.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/hppalinux.sh
@@ -1,3 +1,6 @@
+# If you change this file, please also look at files which source this one:
+# hppanbsd.sh
+
SCRIPT_NAME=elf
ELFSIZE=32
OUTPUT_FORMAT="elf32-hppa-linux"
@@ -8,7 +11,8 @@ ARCH=hppa
MACHINE=hppa1.1 # We use 1.1 specific features.
NOP=0x08000240
START="_start"
-OTHER_READONLY_SECTIONS='.PARISC.unwind : { *(.PARISC.unwind) } '
+OTHER_READONLY_SECTIONS="
+ .PARISC.unwind ${RELOCATING-0} : { *(.PARISC.unwind) }"
DATA_START_SYMBOLS='PROVIDE ($global$ = .);'
DATA_PLT=
GENERATE_SHLIB_SCRIPT=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/hppanbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/hppanbsd.sh
new file mode 100644
index 00000000000..c782c6d4fb5
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/hppanbsd.sh
@@ -0,0 +1,6 @@
+# If you change this file, please also look at files which source this one:
+# hppaobsd.sh
+
+. ${srcdir}/emulparams/hppalinux.sh
+
+OUTPUT_FORMAT="elf32-hppa"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/i386nto.sh b/gnu/usr.bin/binutils/ld/emulparams/i386nto.sh
new file mode 100644
index 00000000000..e4872edec51
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/i386nto.sh
@@ -0,0 +1,12 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-i386"
+TEXT_START_ADDR=0x08048000
+TEXT_START_SYMBOLS='_btext = .;'
+MAXPAGESIZE=0x1000
+NONPAGED_TEXT_START_ADDR=0x08048000
+#SHLIB_TEXT_START_ADDR=0xb0300000
+ARCH=i386
+MACHINE=
+NOP=0x9090
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/m32relf.sh b/gnu/usr.bin/binutils/ld/emulparams/m32relf.sh
index cd7705afff6..c67472abf52 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/m32relf.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/m32relf.sh
@@ -8,6 +8,5 @@ MACHINE=
MAXPAGESIZE=32
EMBEDDED=yes
-# Hmmm, there's got to be a better way. This sets the stack to the
-# top of simulator memory (8MB).
-OTHER_RELOCATING_SECTIONS='PROVIDE (_stack = 0x800000);'
+# This sets the stack to the top of simulator memory (8MB).
+OTHER_END_SYMBOLS='PROVIDE (_stack = 0x800000);'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/m68hc11elf.sh b/gnu/usr.bin/binutils/ld/emulparams/m68hc11elf.sh
index 2f6713e9dac..1caa6e19288 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/m68hc11elf.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/m68hc11elf.sh
@@ -5,9 +5,14 @@ ROM_START_ADDR=0x08000
ROM_SIZE=0x8000
RAM_START_ADDR=0x01100
RAM_SIZE=0x6F00
+EEPROM_START_ADDR=0xb600
+EEPROM_SIZE=512
TEXT_MEMORY=text
DATA_MEMORY=data
+EEPROM_MEMORY=eeprom
ARCH=m68hc11
MAXPAGESIZE=32
EMBEDDED=yes
GENERIC_BOARD=no
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=m68hc1xelf
diff --git a/gnu/usr.bin/binutils/ld/emulparams/m68hc11elfb.sh b/gnu/usr.bin/binutils/ld/emulparams/m68hc11elfb.sh
index 0f3016e2974..a8f01d246fa 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/m68hc11elfb.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/m68hc11elfb.sh
@@ -3,7 +3,10 @@ SCRIPT_NAME=elfm68hc11
OUTPUT_FORMAT="elf32-m68hc11"
TEXT_MEMORY=text
DATA_MEMORY=data
+EEPROM_MEMORY=eeprom
ARCH=m68hc11
MAXPAGESIZE=32
GENERIC_BOARD=yes
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=m68hc1xelf
diff --git a/gnu/usr.bin/binutils/ld/emulparams/m68hc12elf.sh b/gnu/usr.bin/binutils/ld/emulparams/m68hc12elf.sh
index 1d9134c17f2..c4d74871f1a 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/m68hc12elf.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/m68hc12elf.sh
@@ -5,9 +5,14 @@ ROM_START_ADDR=0x08000
ROM_SIZE=0x8000
RAM_START_ADDR=0x01100
RAM_SIZE=0x6F00
+EEPROM_START_ADDR=0x0800
+EEPROM_SIZE=2048
TEXT_MEMORY=text
DATA_MEMORY=data
+EEPROM_MEMORY=eeprom
ARCH=m68hc12
MAXPAGESIZE=32
EMBEDDED=yes
GENERIC_BOARD=no
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=m68hc1xelf
diff --git a/gnu/usr.bin/binutils/ld/emulparams/m68hc12elfb.sh b/gnu/usr.bin/binutils/ld/emulparams/m68hc12elfb.sh
index 211978a3269..acc3ce34d3d 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/m68hc12elfb.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/m68hc12elfb.sh
@@ -3,7 +3,10 @@ SCRIPT_NAME=elfm68hc12
OUTPUT_FORMAT="elf32-m68hc12"
TEXT_MEMORY=text
DATA_MEMORY=data
+EEPROM_MEMORY=eeprom
ARCH=m68hc12
MAXPAGESIZE=32
GENERIC_BOARD=yes
+TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=m68hc1xelf
diff --git a/gnu/usr.bin/binutils/ld/emulparams/m68kelfnbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/m68kelfnbsd.sh
new file mode 100644
index 00000000000..69e328dd053
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/m68kelfnbsd.sh
@@ -0,0 +1,4 @@
+. ${srcdir}/emulparams/m68kelf.sh
+TEXT_START_ADDR=0x2000
+TARGET_PAGE_SIZE=0x2000
+MACHINE=
diff --git a/gnu/usr.bin/binutils/ld/emulparams/mmo.sh b/gnu/usr.bin/binutils/ld/emulparams/mmo.sh
new file mode 100644
index 00000000000..e0a87981145
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/mmo.sh
@@ -0,0 +1,10 @@
+SCRIPT_NAME=mmo
+TARGET_PAGE_SIZE=256
+
+# Default to 0 as mmixal does.
+TEXT_START_ADDR='DEFINED (__.MMIX.start..text) ? __.MMIX.start..text : 0'
+DATA_ADDR='DEFINED (__.MMIX.start..data) ? __.MMIX.start..data : 0x2000000000000000'
+OUTPUT_FORMAT=mmo
+ARCH=mmix
+COMPILE_IN=yes
+EXTRA_EM_FILE=mmo
diff --git a/gnu/usr.bin/binutils/ld/emulparams/mn10200.sh b/gnu/usr.bin/binutils/ld/emulparams/mn10200.sh
index 63243225e37..f96224b0492 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/mn10200.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/mn10200.sh
@@ -1,4 +1,6 @@
-MACHINE=
+# If you change this file, please also look at files which source this one:
+# mn10300.sh
+
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-mn10200"
TEXT_START_ADDR=0x0
@@ -8,9 +10,8 @@ MAXPAGESIZE=1
ENTRY=_start
EMBEDDED=yes
-# Hmmm, there's got to be a better way. This sets the stack to the
-# top of the simulator memory (2^19 bytes).
-OTHER_RELOCATING_SECTIONS='.stack 0x80000 : { _stack = .; *(.stack) }'
+# This sets the stack to the top of the simulator memory (2^19 bytes).
+STACK_ADDR=0x80000
# These are for compatibility with the COFF toolchain.
# XXX These should definitely disappear.
diff --git a/gnu/usr.bin/binutils/ld/emulparams/mn10300.sh b/gnu/usr.bin/binutils/ld/emulparams/mn10300.sh
index 44a40e5a764..eec2f84ca82 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/mn10300.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/mn10300.sh
@@ -1,20 +1,3 @@
-MACHINE=
-SCRIPT_NAME=elf
+. ${srcdir}/emulparams/mn10200.sh
OUTPUT_FORMAT="elf32-mn10300"
-TEXT_START_ADDR=0x0
ARCH=mn10300
-MACHINE=
-MAXPAGESIZE=1
-ENTRY=_start
-EMBEDDED=yes
-
-# Hmmm, there's got to be a better way. This sets the stack to the
-# top of the simulator memory (2^19 bytes).
-OTHER_RELOCATING_SECTIONS='.stack 0x80000 : { _stack = .; *(.stack) }'
-
-# These are for compatibility with the COFF toolchain.
-# XXX These should definitely disappear.
-CTOR_START='___ctors = .;'
-CTOR_END='___ctors_end = .;'
-DTOR_START='___dtors = .;'
-DTOR_END='___dtors_end = .;'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x110.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x110.sh
new file mode 100644
index 00000000000..54e8272dc3d
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x110.sh
@@ -0,0 +1,14 @@
+ARCH=msp:11
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xfc00
+ROM_SIZE=0x3e0
+RAM_START=0x0200
+RAM_SIZE=128
+
+STACK=0x280
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x1101.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x1101.sh
new file mode 100644
index 00000000000..9a0273c524e
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x1101.sh
@@ -0,0 +1,14 @@
+ARCH=msp:110
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xfc00
+ROM_SIZE=0x3e0
+RAM_START=0x0200
+RAM_SIZE=128
+
+STACK=0x280
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x1111.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x1111.sh
new file mode 100644
index 00000000000..c8c95e237c1
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x1111.sh
@@ -0,0 +1,14 @@
+ARCH=msp:110
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xf800
+ROM_SIZE=0x07e0
+RAM_START=0x0200
+RAM_SIZE=128
+
+STACK=0x280
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x112.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x112.sh
new file mode 100644
index 00000000000..0b74404b98e
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x112.sh
@@ -0,0 +1,14 @@
+ARCH=msp:11
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xf000
+ROM_SIZE=0xfe0
+RAM_START=0x0200
+RAM_SIZE=256
+
+STACK=0x300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x1121.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x1121.sh
new file mode 100644
index 00000000000..e190c2a6219
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x1121.sh
@@ -0,0 +1,14 @@
+ARCH=msp:110
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xf000
+ROM_SIZE=0x0fe0
+RAM_START=0x0200
+RAM_SIZE=256
+
+STACK=0x300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x1122.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x1122.sh
new file mode 100644
index 00000000000..e190c2a6219
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x1122.sh
@@ -0,0 +1,14 @@
+ARCH=msp:110
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xf000
+ROM_SIZE=0x0fe0
+RAM_START=0x0200
+RAM_SIZE=256
+
+STACK=0x300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x1132.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x1132.sh
new file mode 100644
index 00000000000..e9da1a86dec
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x1132.sh
@@ -0,0 +1,14 @@
+ARCH=msp:110
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xe000
+ROM_SIZE=0x1fe0
+RAM_START=0x0200
+RAM_SIZE=256
+
+STACK=0x300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x122.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x122.sh
new file mode 100644
index 00000000000..ee2ba40675c
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x122.sh
@@ -0,0 +1,14 @@
+ARCH=msp:12
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xf000
+ROM_SIZE=0xfe0
+RAM_START=0x0200
+RAM_SIZE=256
+
+STACK=0x300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x1222.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x1222.sh
new file mode 100644
index 00000000000..ee2ba40675c
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x1222.sh
@@ -0,0 +1,14 @@
+ARCH=msp:12
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xf000
+ROM_SIZE=0xfe0
+RAM_START=0x0200
+RAM_SIZE=256
+
+STACK=0x300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x123.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x123.sh
new file mode 100644
index 00000000000..6d946bc2333
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x123.sh
@@ -0,0 +1,14 @@
+ARCH=msp:12
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xe000
+ROM_SIZE=0x1fe0
+RAM_START=0x0200
+RAM_SIZE=256
+
+STACK=0x300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x1232.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x1232.sh
new file mode 100644
index 00000000000..6d946bc2333
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x1232.sh
@@ -0,0 +1,14 @@
+ARCH=msp:12
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xe000
+ROM_SIZE=0x1fe0
+RAM_START=0x0200
+RAM_SIZE=256
+
+STACK=0x300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x133.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x133.sh
new file mode 100644
index 00000000000..1d6104f57c5
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x133.sh
@@ -0,0 +1,14 @@
+ARCH=msp:13
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xe000
+ROM_SIZE=0x1fe0
+RAM_START=0x0200
+RAM_SIZE=256
+
+STACK=0x300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x1331.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x1331.sh
new file mode 100644
index 00000000000..1d6104f57c5
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x1331.sh
@@ -0,0 +1,14 @@
+ARCH=msp:13
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xe000
+ROM_SIZE=0x1fe0
+RAM_START=0x0200
+RAM_SIZE=256
+
+STACK=0x300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x135.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x135.sh
new file mode 100644
index 00000000000..f2eb5448ee9
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x135.sh
@@ -0,0 +1,14 @@
+ARCH=msp:13
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xc000
+ROM_SIZE=0x3fe0
+RAM_START=0x0200
+RAM_SIZE=512
+
+STACK=0x400
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x1351.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x1351.sh
new file mode 100644
index 00000000000..f2eb5448ee9
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x1351.sh
@@ -0,0 +1,14 @@
+ARCH=msp:13
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xc000
+ROM_SIZE=0x3fe0
+RAM_START=0x0200
+RAM_SIZE=512
+
+STACK=0x400
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x147.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x147.sh
new file mode 100644
index 00000000000..a2747b7d6d4
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x147.sh
@@ -0,0 +1,14 @@
+ARCH=msp:14
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0x8000
+ROM_SIZE=0x7fe0
+RAM_START=0x0200
+RAM_SIZE=1K
+
+STACK=0x600
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x148.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x148.sh
new file mode 100644
index 00000000000..5954c70a86d
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x148.sh
@@ -0,0 +1,14 @@
+ARCH=msp:14
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0x4000
+ROM_SIZE=0xbef0
+RAM_START=0x0200
+RAM_SIZE=0x07ff
+
+STACK=0xa00
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x149.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x149.sh
new file mode 100644
index 00000000000..a695876e38b
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x149.sh
@@ -0,0 +1,14 @@
+ARCH=msp:14
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0x1100
+ROM_SIZE=0xeee0
+RAM_START=0x0200
+RAM_SIZE=0x07ff
+
+STACK=0xa00
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x155.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x155.sh
new file mode 100644
index 00000000000..5b1c8380bc2
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x155.sh
@@ -0,0 +1,14 @@
+ARCH=msp:15
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xc000
+ROM_SIZE=0x3fe0
+RAM_START=0x0200
+RAM_SIZE=512
+
+STACK=0x400
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x156.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x156.sh
new file mode 100644
index 00000000000..0bb2867694e
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x156.sh
@@ -0,0 +1,14 @@
+ARCH=msp:15
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xa000
+ROM_SIZE=0x5fe0
+RAM_START=0x0200
+RAM_SIZE=512
+
+STACK=0x400
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x157.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x157.sh
new file mode 100644
index 00000000000..21ea6f68331
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x157.sh
@@ -0,0 +1,14 @@
+ARCH=msp:15
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0x8000
+ROM_SIZE=0x7fe0
+RAM_START=0x0200
+RAM_SIZE=1K
+
+STACK=0x600
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x167.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x167.sh
new file mode 100644
index 00000000000..3b942f740f2
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x167.sh
@@ -0,0 +1,14 @@
+ARCH=msp:16
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0x8000
+ROM_SIZE=0x7fe0
+RAM_START=0x0200
+RAM_SIZE=1K
+
+STACK=0x600
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x168.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x168.sh
new file mode 100644
index 00000000000..f92e6d4d788
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x168.sh
@@ -0,0 +1,14 @@
+ARCH=msp:16
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0x4000
+ROM_SIZE=0xbef0
+RAM_START=0x0200
+RAM_SIZE=0x07ff
+
+STACK=0xa00
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x169.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x169.sh
new file mode 100644
index 00000000000..72b0983888c
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x169.sh
@@ -0,0 +1,14 @@
+ARCH=msp:16
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0x1100
+ROM_SIZE=0xeee0
+RAM_START=0x0200
+RAM_SIZE=0x07ff
+
+STACK=0xa00
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x311.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x311.sh
new file mode 100644
index 00000000000..eebad54ed29
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x311.sh
@@ -0,0 +1,14 @@
+ARCH=msp:31
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xf800
+ROM_SIZE=0x07e0
+RAM_START=0x0200
+RAM_SIZE=128
+
+STACK=0x280
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x312.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x312.sh
new file mode 100644
index 00000000000..789c73b72ba
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x312.sh
@@ -0,0 +1,14 @@
+ARCH=msp:31
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xf000
+ROM_SIZE=0x0fe0
+RAM_START=0x0200
+RAM_SIZE=256
+
+STACK=0x300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x313.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x313.sh
new file mode 100644
index 00000000000..8fac19fc58d
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x313.sh
@@ -0,0 +1,14 @@
+ARCH=msp:31
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xe000
+ROM_SIZE=0x1fe0
+RAM_START=0x0200
+RAM_SIZE=256
+
+STACK=0x300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x314.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x314.sh
new file mode 100644
index 00000000000..3ef19875949
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x314.sh
@@ -0,0 +1,14 @@
+ARCH=msp:31
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xd000
+ROM_SIZE=0x2fe0
+RAM_START=0x0200
+RAM_SIZE=512
+
+STACK=0x400
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x315.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x315.sh
new file mode 100644
index 00000000000..4156eb684a1
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x315.sh
@@ -0,0 +1,14 @@
+ARCH=msp:31
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xc000
+ROM_SIZE=0x3fe0
+RAM_START=0x0200
+RAM_SIZE=512
+
+STACK=0x400
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x323.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x323.sh
new file mode 100644
index 00000000000..13b9d517098
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x323.sh
@@ -0,0 +1,14 @@
+ARCH=msp:32
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xe000
+ROM_SIZE=0x1fe0
+RAM_START=0x0200
+RAM_SIZE=256
+
+STACK=0x300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x325.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x325.sh
new file mode 100644
index 00000000000..3c8e351e3f0
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x325.sh
@@ -0,0 +1,14 @@
+ARCH=msp:32
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xc000
+ROM_SIZE=0x3fe0
+RAM_START=0x0200
+RAM_SIZE=512
+
+STACK=0x400
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x336.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x336.sh
new file mode 100644
index 00000000000..c0dc08c917e
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x336.sh
@@ -0,0 +1,14 @@
+ARCH=msp:33
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xa000
+ROM_SIZE=0x5fe0
+RAM_START=0x0200
+RAM_SIZE=1024
+
+STACK=0x600
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x337.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x337.sh
new file mode 100644
index 00000000000..a52d12948af
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x337.sh
@@ -0,0 +1,14 @@
+ARCH=msp:33
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0x8000
+ROM_SIZE=0x7fe0
+RAM_START=0x0200
+RAM_SIZE=1024
+
+STACK=0x600
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x412.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x412.sh
new file mode 100644
index 00000000000..1a1f68b41d1
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x412.sh
@@ -0,0 +1,14 @@
+ARCH=msp:41
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xf000
+ROM_SIZE=0x0fe0
+RAM_START=0x0200
+RAM_SIZE=256
+
+STACK=0x300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x413.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x413.sh
new file mode 100644
index 00000000000..d3a739d323e
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x413.sh
@@ -0,0 +1,14 @@
+ARCH=msp:41
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xe000
+ROM_SIZE=0x1fe0
+RAM_START=0x0200
+RAM_SIZE=256
+
+STACK=0x300
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x435.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x435.sh
new file mode 100644
index 00000000000..d625acea353
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x435.sh
@@ -0,0 +1,14 @@
+ARCH=msp:43
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xc000
+ROM_SIZE=0x3fe0
+RAM_START=0x0200
+RAM_SIZE=512
+
+STACK=0x400
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x436.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x436.sh
new file mode 100644
index 00000000000..75f711b1a02
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x436.sh
@@ -0,0 +1,14 @@
+ARCH=msp:43
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0xa000
+ROM_SIZE=0x5fe0
+RAM_START=0x0200
+RAM_SIZE=1024
+
+STACK=0x600
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x437.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x437.sh
new file mode 100644
index 00000000000..92de8cccd41
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x437.sh
@@ -0,0 +1,14 @@
+ARCH=msp:43
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0x8000
+ROM_SIZE=0x7fe0
+RAM_START=0x0200
+RAM_SIZE=1024
+
+STACK=0x600
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x447.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x447.sh
new file mode 100644
index 00000000000..058cc07132f
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x447.sh
@@ -0,0 +1,14 @@
+ARCH=msp:44
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0x8000
+ROM_SIZE=0x7fe0
+RAM_START=0x0200
+RAM_SIZE=1K
+
+STACK=0x600
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x448.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x448.sh
new file mode 100644
index 00000000000..e8820ce93ad
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x448.sh
@@ -0,0 +1,14 @@
+ARCH=msp:44
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0x4000
+ROM_SIZE=0xbef0
+RAM_START=0x0200
+RAM_SIZE=0x07ff
+
+STACK=0xa00
diff --git a/gnu/usr.bin/binutils/ld/emulparams/msp430x449.sh b/gnu/usr.bin/binutils/ld/emulparams/msp430x449.sh
new file mode 100644
index 00000000000..9c3442eb48c
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/msp430x449.sh
@@ -0,0 +1,14 @@
+ARCH=msp:44
+MACHINE=
+SCRIPT_NAME=elf32msp430
+OUTPUT_FORMAT="elf32-msp430"
+MAXPAGESIZE=1
+EMBEDDED=yes
+TEMPLATE_NAME=generic
+
+ROM_START=0x1100
+ROM_SIZE=0xeee0
+RAM_START=0x0200
+RAM_SIZE=0x07ff
+
+STACK=0xa00
diff --git a/gnu/usr.bin/binutils/ld/emulparams/or32.sh b/gnu/usr.bin/binutils/ld/emulparams/or32.sh
new file mode 100644
index 00000000000..0717eb7e06c
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/or32.sh
@@ -0,0 +1,6 @@
+SCRIPT_NAME=or32
+OUTPUT_FORMAT="coff-or32-big"
+# OUTPUT_FORMAT="elf32-or32"
+TEXT_START_ADDR=0x1000000
+TARGET_PAGE_SIZE=0x1000000
+ARCH=or32
diff --git a/gnu/usr.bin/binutils/ld/emulparams/or32elf.sh b/gnu/usr.bin/binutils/ld/emulparams/or32elf.sh
new file mode 100644
index 00000000000..04d163038e5
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/or32elf.sh
@@ -0,0 +1,6 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-or32"
+TEXT_START_ADDR=0x1000000
+TARGET_PAGE_SIZE=0x1000000
+MAXPAGESIZE=0x1000
+ARCH=or32
diff --git a/gnu/usr.bin/binutils/ld/emulparams/pdp11.sh b/gnu/usr.bin/binutils/ld/emulparams/pdp11.sh
new file mode 100644
index 00000000000..aaf955afc87
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/pdp11.sh
@@ -0,0 +1,5 @@
+SCRIPT_NAME=aout
+OUTPUT_FORMAT="a.out-pdp11"
+TEXT_START_ADDR=0
+TARGET_PAGE_SIZE=256
+ARCH=pdp11
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shelf.sh b/gnu/usr.bin/binutils/ld/emulparams/shelf.sh
index 95db5877d7f..5c0c9d640e8 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/shelf.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/shelf.sh
@@ -1,3 +1,6 @@
+# If you change this file, please also look at files which source this one:
+# shlelf.sh, shelf_nbsd.sh
+
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-sh"
TEXT_START_ADDR=0x1000
@@ -14,4 +17,16 @@ CTOR_START='___ctors = .;'
CTOR_END='___ctors_end = .;'
DTOR_START='___dtors = .;'
DTOR_END='___dtors_end = .;'
-OTHER_RELOCATING_SECTIONS='.stack 0x30000 : { _stack = .; *(.stack) }'
+# This is like setting STACK_ADDR to 0x30000, except that the setting can
+# be overridden, e.g. --defsym _stack=0x0f00, and that we put an extra
+# sentinal value at the bottom.
+# N.B. We can't use PROVIDE to set the default value in a symbol because
+# the address is needed to place the .stack section, which in turn is needed
+# to hold the sentinel value(s).
+OTHER_SECTIONS=" .stack ${RELOCATING-0}${RELOCATING+(DEFINED(_stack) ? _stack : 0x30000)} :
+ {
+ ${RELOCATING+_stack = .;}
+ *(.stack)
+ LONG(0xdeaddead)
+ }"
+
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shelf32.sh b/gnu/usr.bin/binutils/ld/emulparams/shelf32.sh
new file mode 100644
index 00000000000..c05da3f90bf
--- /dev/null
+++ b/gnu/usr.bin/binutils/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=sh5
+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/gnu/usr.bin/binutils/ld/emulparams/shelf32_linux.sh b/gnu/usr.bin/binutils/ld/emulparams/shelf32_linux.sh
new file mode 100644
index 00000000000..a51e22fb8db
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/shelf32_linux.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/shlelf32_linux.sh
+OUTPUT_FORMAT="elf32-sh64big-linux"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shelf32_nbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/shelf32_nbsd.sh
new file mode 100644
index 00000000000..edd6216860f
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/shelf32_nbsd.sh
@@ -0,0 +1,13 @@
+# If you change this file, please alsolook at files which source this one:
+# shlelf32_nbsd.sh
+
+. ${srcdir}/emulparams/shelf32.sh
+
+OUTPUT_FORMAT="elf32-sh64-nbsd"
+TEXT_START_ADDR=0x400000
+MAXPAGESIZE=0x10000
+
+ENTRY=__start
+
+unset EMBEDDED
+unset STACK_ADDR
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shelf64.sh b/gnu/usr.bin/binutils/ld/emulparams/shelf64.sh
new file mode 100644
index 00000000000..2c9a9c513bd
--- /dev/null
+++ b/gnu/usr.bin/binutils/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/gnu/usr.bin/binutils/ld/emulparams/shelf64_nbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/shelf64_nbsd.sh
new file mode 100644
index 00000000000..7a3ff21d207
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/shelf64_nbsd.sh
@@ -0,0 +1,8 @@
+. ${srcdir}/emulparams/shelf32_nbsd.sh
+
+OUTPUT_FORMAT="elf64-sh64-nbsd"
+ELFSIZE=64
+
+# We do not need .cranges
+OTHER_SECTIONS=''
+EXTRA_EM_FILE=
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shelf_linux.sh b/gnu/usr.bin/binutils/ld/emulparams/shelf_linux.sh
index d7b7631fe63..b841beff407 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/shelf_linux.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/shelf_linux.sh
@@ -1,14 +1,2 @@
-SCRIPT_NAME=elf
+. ${srcdir}/emulparams/shlelf_linux.sh
OUTPUT_FORMAT="elf32-shbig-linux"
-TEXT_START_ADDR=0x400000
-MAXPAGESIZE=0x10000
-ARCH=sh
-MACHINE=
-TEMPLATE_NAME=elf32
-GENERATE_SHLIB_SCRIPT=yes
-
-DATA_START_SYMBOLS='__data_start = . ;';
-
-OTHER_READWRITE_SECTIONS='
- .note.ABI-tag : { *(.note.ABI-tag) }
-'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shelf_nbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/shelf_nbsd.sh
new file mode 100644
index 00000000000..3fcd4925492
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/shelf_nbsd.sh
@@ -0,0 +1,15 @@
+# If you change this file, please alsolook at files which source this one:
+# shlelf_nbsd.sh
+
+. ${srcdir}/emulparams/shelf.sh
+
+OUTPUT_FORMAT="elf32-sh-nbsd"
+TEXT_START_ADDR=0x400000
+MAXPAGESIZE=0x10000
+
+DATA_START_SYMBOLS='__data_start = . ;';
+
+ENTRY=_start
+
+unset EMBEDDED
+unset OTHER_SECTIONS
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shelf_nto.sh b/gnu/usr.bin/binutils/ld/emulparams/shelf_nto.sh
new file mode 100644
index 00000000000..f2252fb845f
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/shelf_nto.sh
@@ -0,0 +1,10 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-sh"
+TEXT_START_ADDR=0x08040000
+MAXPAGESIZE=0x1000
+ARCH=sh
+MACHINE=
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+TEXT_START_SYMBOLS='_btext = .;'
+ENTRY=_start
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shlelf.sh b/gnu/usr.bin/binutils/ld/emulparams/shlelf.sh
index bb27f86af6c..e19678bc710 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/shlelf.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/shlelf.sh
@@ -1,17 +1,2 @@
-SCRIPT_NAME=elf
+. ${srcdir}/emulparams/shelf.sh
OUTPUT_FORMAT="elf32-shl"
-TEXT_START_ADDR=0x1000
-MAXPAGESIZE=128
-ARCH=sh
-MACHINE=
-TEMPLATE_NAME=elf32
-GENERATE_SHLIB_SCRIPT=yes
-EMBEDDED=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 = .;'
-OTHER_RELOCATING_SECTIONS='.stack 0x30000 : { _stack = .; *(.stack) }'
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shlelf32.sh b/gnu/usr.bin/binutils/ld/emulparams/shlelf32.sh
new file mode 100644
index 00000000000..68c85dd9879
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/shlelf32.sh
@@ -0,0 +1,2 @@
+OUTPUT_FORMAT="elf32-sh64l"
+. ${srcdir}/emulparams/shelf32.sh
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shlelf32_linux.sh b/gnu/usr.bin/binutils/ld/emulparams/shlelf32_linux.sh
new file mode 100644
index 00000000000..01b9ce36c98
--- /dev/null
+++ b/gnu/usr.bin/binutils/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}
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shlelf32_nbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/shlelf32_nbsd.sh
new file mode 100644
index 00000000000..c4abe6befb7
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/shlelf32_nbsd.sh
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/shelf32_nbsd.sh
+
+OUTPUT_FORMAT="elf32-sh64l-nbsd"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shlelf64.sh b/gnu/usr.bin/binutils/ld/emulparams/shlelf64.sh
new file mode 100644
index 00000000000..874b00c0106
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/shlelf64.sh
@@ -0,0 +1,2 @@
+OUTPUT_FORMAT="elf64-sh64l"
+. ${srcdir}/emulparams/shelf64.sh
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shlelf64_nbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/shlelf64_nbsd.sh
new file mode 100644
index 00000000000..5b693c35fcf
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/shlelf64_nbsd.sh
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/shelf64_nbsd.sh
+
+OUTPUT_FORMAT="elf64-sh64l-nbsd"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shlelf_linux.sh b/gnu/usr.bin/binutils/ld/emulparams/shlelf_linux.sh
index 191def73bf9..875b2f3750b 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/shlelf_linux.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/shlelf_linux.sh
@@ -1,3 +1,6 @@
+# If you change this file, please also look at files which source this one:
+# shelf_linux.sh
+
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-sh-linux"
TEXT_START_ADDR=0x400000
@@ -9,6 +12,5 @@ GENERATE_SHLIB_SCRIPT=yes
DATA_START_SYMBOLS='__data_start = . ;';
-OTHER_READWRITE_SECTIONS='
- .note.ABI-tag : { *(.note.ABI-tag) }
-'
+OTHER_READWRITE_SECTIONS="
+ .note.ABI-tag ${RELOCATING-0} : { *(.note.ABI-tag) }"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shlelf_nbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/shlelf_nbsd.sh
new file mode 100644
index 00000000000..d6ca82e36c7
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/shlelf_nbsd.sh
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/shelf_nbsd.sh
+
+OUTPUT_FORMAT="elf32-shl-nbsd"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shlelf_nto.sh b/gnu/usr.bin/binutils/ld/emulparams/shlelf_nto.sh
new file mode 100644
index 00000000000..d23e69a6c47
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/shlelf_nto.sh
@@ -0,0 +1,10 @@
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-shl"
+TEXT_START_ADDR=0x08040000
+MAXPAGESIZE=0x1000
+ARCH=sh
+MACHINE=
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+TEXT_START_SYMBOLS='_btext = .;'
+ENTRY=_start
diff --git a/gnu/usr.bin/binutils/ld/emulparams/tic3xcoff.sh b/gnu/usr.bin/binutils/ld/emulparams/tic3xcoff.sh
new file mode 100644
index 00000000000..be543bf9d44
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/tic3xcoff.sh
@@ -0,0 +1,6 @@
+SCRIPT_NAME=tic4xcoff
+OUTPUT_FORMAT="coff2-tic4x"
+OUTPUT_ARCH="tic3x"
+ARCH=tic3x
+TEMPLATE_NAME=ticoff
+OUTPUT_FORMAT_TEMPLATE=tic4x
diff --git a/gnu/usr.bin/binutils/ld/emulparams/tic3xcoff_onchip.sh b/gnu/usr.bin/binutils/ld/emulparams/tic3xcoff_onchip.sh
new file mode 100644
index 00000000000..1c1f8b1eaaf
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/tic3xcoff_onchip.sh
@@ -0,0 +1,8 @@
+SCRIPT_NAME=tic4xcoff
+OUTPUT_FORMAT="coff2-tic4x"
+OUTPUT_ARCH="tic3x"
+ARCH=tic3x
+TEMPLATE_NAME=ticoff
+OUTPUT_FORMAT_TEMPLATE=tic4x
+ONCHIP=yes
+
diff --git a/gnu/usr.bin/binutils/ld/emulparams/tic4xcoff.sh b/gnu/usr.bin/binutils/ld/emulparams/tic4xcoff.sh
new file mode 100644
index 00000000000..210957217d1
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/tic4xcoff.sh
@@ -0,0 +1,6 @@
+SCRIPT_NAME=tic4xcoff
+OUTPUT_FORMAT="coff2-tic4x"
+OUTPUT_ARCH="tic4x"
+ARCH=tic4x
+TEMPLATE_NAME=ticoff
+OUTPUT_FORMAT_TEMPLATE=tic4x
diff --git a/gnu/usr.bin/binutils/ld/emulparams/v850.sh b/gnu/usr.bin/binutils/ld/emulparams/v850.sh
index 78bfbd3882d..96cdc680884 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/v850.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/v850.sh
@@ -12,3 +12,4 @@ ARCH=v850
MAXPAGESIZE=256
ENTRY=_start
EMBEDDED=yes
+TEMPLATE_NAME=elf32
diff --git a/gnu/usr.bin/binutils/ld/emulparams/vaxnbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/vaxnbsd.sh
new file mode 100644
index 00000000000..b16813fdcdf
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/vaxnbsd.sh
@@ -0,0 +1,7 @@
+SCRIPT_NAME=aout
+TEXT_START_ADDR=0x1020
+OUTPUT_FORMAT="a.out-vax-netbsd"
+TARGET_PAGE_SIZE=0x1000
+ARCH=vax
+EXECUTABLE_SYMBOLS='__DYNAMIC = 0;'
+NONPAGED_TEXT_START_ADDR=0x1000
diff --git a/gnu/usr.bin/binutils/ld/emulparams/xtensa-config.sh b/gnu/usr.bin/binutils/ld/emulparams/xtensa-config.sh
new file mode 100644
index 00000000000..5a5e504edde
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/xtensa-config.sh
@@ -0,0 +1,3 @@
+# Xtensa configuration settings.
+
+MAXPAGESIZE=0x1000