summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/ld/emulparams
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2004-05-17 21:54:57 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2004-05-17 21:54:57 +0000
commit631eeff208608ed7b44459bd6c8ae905bcd7e8b6 (patch)
tree7be124105a0929655708fbbc134f9c2e3189c3f3 /gnu/usr.bin/binutils/ld/emulparams
parenta7c8e0ae4a4b349099d02bc9d56bcf1979c0f0c3 (diff)
Resolve merge conflicts, adjust method of W^X handing (.sh files)
remove testsuites (not useable) remove mmalloc (not part of new binutils).
Diffstat (limited to 'gnu/usr.bin/binutils/ld/emulparams')
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/aixppc.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/aixrs6.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/armelf_linux26.sh20
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/armelf_obsd.sh7
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/armelfb_obsd.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32_sparc.sh9
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32_sparc_obsd.sh4
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32arc.sh27
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32b4300.sh35
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32bmip.sh20
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32l4300.sh27
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32lmip.sh31
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32lppc.sh21
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh42
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf32ppc_obsd.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh58
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64_sparc_obsd.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64alpha.sh65
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf64alpha_obsd.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh12
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf_i386_obsd.sh10
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf_obsd.sh7
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf_x86_64.sh31
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/elf_x86_64_obsd.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/hppaobsd.sh28
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/i386moss.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/i386nw.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/i386obsd.sh8
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/m68kelf.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/m68kobsd.sh9
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/mipseb_obsd.sh27
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/mipsel_obsd.sh27
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/ns32knbsd.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/ppcmacos.sh2
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/sh.sh3
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/shl.sh5
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/sparcobsd.sh7
-rw-r--r--gnu/usr.bin/binutils/ld/emulparams/vax.sh2
38 files changed, 216 insertions, 355 deletions
diff --git a/gnu/usr.bin/binutils/ld/emulparams/aixppc.sh b/gnu/usr.bin/binutils/ld/emulparams/aixppc.sh
index f92e686dd6d..9307693a3ad 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/aixppc.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/aixppc.sh
@@ -1,4 +1,7 @@
TEMPLATE_NAME=aix
SCRIPT_NAME=aix
OUTPUT_FORMAT="aixcoff-rs6000"
+OUTPUT_FORMAT_32BIT="aixcoff-rs6000"
+OUTPUT_FORMAT_64BIT="aixcoff64-rs6000"
ARCH=powerpc
+
diff --git a/gnu/usr.bin/binutils/ld/emulparams/aixrs6.sh b/gnu/usr.bin/binutils/ld/emulparams/aixrs6.sh
index 733c3f7ab0f..6033dc1763c 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/aixrs6.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/aixrs6.sh
@@ -1,4 +1,7 @@
TEMPLATE_NAME=aix
SCRIPT_NAME=aix
OUTPUT_FORMAT="aixcoff-rs6000"
+OUTPUT_FORMAT_32BIT="aixcoff-rs6000"
+OUTPUT_FORMAT_64BIT="aixcoff64-rs6000"
ARCH=rs6000
+
diff --git a/gnu/usr.bin/binutils/ld/emulparams/armelf_linux26.sh b/gnu/usr.bin/binutils/ld/emulparams/armelf_linux26.sh
deleted file mode 100644
index 36d1b0ec5c7..00000000000
--- a/gnu/usr.bin/binutils/ld/emulparams/armelf_linux26.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-ARCH=arm
-SCRIPT_NAME=elf
-OUTPUT_FORMAT="elf32-littlearm"
-BIG_OUTPUT_FORMAT="elf32-bigarm"
-LITTLE_OUTPUT_FORMAT="elf32-littlearm"
-MAXPAGESIZE=0x8000
-TEMPLATE_NAME=armelf
-GENERATE_SHLIB_SCRIPT=yes
-
-DATA_START_SYMBOLS='__data_start = . ;';
-OTHER_BSS_SYMBOLS='__bss_start__ = .;'
-OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;'
-
-# This needs to be high enough so that we can load ld.so below it,
-# yet low enough to stay away from the mmap area at 0x01100000.
-# Also, it is small enough so that relocs which are pointing
-# at absolute 0 will still be fixed up.
-# These values give us about 0.5MB for ld.so, 16.5MB for user
-# programs, and 15MB for mmap which seems a reasonable compromise.
-TEXT_START_ADDR=0x00080000
diff --git a/gnu/usr.bin/binutils/ld/emulparams/armelf_obsd.sh b/gnu/usr.bin/binutils/ld/emulparams/armelf_obsd.sh
new file mode 100644
index 00000000000..3194a717d57
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/armelf_obsd.sh
@@ -0,0 +1,7 @@
+. ${srcdir}/emulparams/armelf.sh
+. ${srcdir}/emulparams/elf_obsd.sh
+
+MAXPAGESIZE=0x8000
+TEXT_START_ADDR=0x00008000
+
+unset EMBEDDED
diff --git a/gnu/usr.bin/binutils/ld/emulparams/armelfb_obsd.sh b/gnu/usr.bin/binutils/ld/emulparams/armelfb_obsd.sh
new file mode 100644
index 00000000000..8c35c13c276
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/armelfb_obsd.sh
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/armelf_obsd.sh
+
+OUTPUT_FORMAT="elf32-bigarm"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32_sparc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32_sparc.sh
index eab69a77956..15a837df28c 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32_sparc.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32_sparc.sh
@@ -1,16 +1,13 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-sparc"
TEXT_START_ADDR=0x10000
-MAXPAGESIZE=0x100000
+MAXPAGESIZE=0x10000
+COMMONPAGESIZE=0x2000
NONPAGED_TEXT_START_ADDR=0x10000
ALIGNMENT=8
ARCH=sparc
MACHINE=
TEMPLATE_NAME=elf32
DATA_PLT=
-PAD_RO=
-RODATA_PADSIZE=${MAXPAGESIZE}
-RODATA_ALIGN=". = ALIGN(${RODATA_PADSIZE}) + (. & (${RODATA_PADSIZE} - 1))"
-PAD_PLT=
-PAD_GOT=
GENERATE_SHLIB_SCRIPT=yes
+NO_SMALL_DATA=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32_sparc_obsd.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32_sparc_obsd.sh
new file mode 100644
index 00000000000..3f36d6954ec
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32_sparc_obsd.sh
@@ -0,0 +1,4 @@
+. ${srcdir}/emulparams/elf32_sparc.sh
+#override MAXPAGESIZE to avoid cache aliasing.
+MAXPAGESIZE=0x100000
+. ${srcdir}/emulparams/elf_obsd.sh
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32arc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32arc.sh
deleted file mode 100644
index d9fc6de726b..00000000000
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32arc.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-SCRIPT_NAME=elfmips
-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
-OTHER_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
-OTHER_GOT_SYMBOLS='
- _gp = ALIGN(16) + 0x7ff0;
-'
-OTHER_READWRITE_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
-TEMPLATE_NAME=elfarc
-GENERATE_SHLIB_SCRIPT=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32b4300.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32b4300.sh
index 24f8d98eab0..d3e43547dd3 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32b4300.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32b4300.sh
@@ -1,29 +1,10 @@
-SCRIPT_NAME=elf
-OUTPUT_FORMAT="elf32-bigmips"
-BIG_OUTPUT_FORMAT="elf32-bigmips"
-LITTLE_OUTPUT_FORMAT="elf32-littlemips"
+# If you change this file, please also look at files which source this one:
+# elf32l4300.sh
+
+EMBEDDED=yes
+. ${srcdir}/emulparams/elf32bmip.sh
TEXT_START_ADDR=0xa0020000
-MAXPAGESIZE=0x40000
-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 = .;'
+unset NONPAGED_TEXT_START_ADDR
+unset SHLIB_TEXT_START_ADDR
EXECUTABLE_SYMBOLS='_DYNAMIC_LINK = 0;'
-OTHER_SECTIONS='
- .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
- .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
-'
-ARCH=mips
-MACHINE=
-TEMPLATE_NAME=elf32
-GENERATE_SHLIB_SCRIPT=yes
-DYNAMIC_LINK=false
-EMBEDDED=yes
+DYNAMIC_LINK=FALSE
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32bmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32bmip.sh
index 473c41169e0..fa7d671ffdf 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32bmip.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32bmip.sh
@@ -1,22 +1,27 @@
+# If you change this file, please also look at files which source this one:
+# elf32b4300.sh elf32bsmip.sh elf32btsmip.sh elf32ebmip.sh elf32lmip.sh
+
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-bigmips"
BIG_OUTPUT_FORMAT="elf32-bigmips"
LITTLE_OUTPUT_FORMAT="elf32-littlemips"
TEXT_START_ADDR=0x0400000
-DATA_ADDR=0x10000000
+test -n "${EMBEDDED}" || DATA_ADDR=0x10000000
MAXPAGESIZE=0x40000
NONPAGED_TEXT_START_ADDR=0x0400000
SHLIB_TEXT_START_ADDR=0x5ffe0000
-TEXT_DYNAMIC=
-INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
+test -n "${EMBEDDED}" || TEXT_DYNAMIC=
+INITIAL_READONLY_SECTIONS="
+ .reginfo ${RELOCATING-0} : { *(.reginfo) }
+"
OTHER_TEXT_SECTIONS='*(.mips16.fn.*) *(.mips16.call.*)'
OTHER_GOT_SYMBOLS='
_gp = ALIGN(16) + 0x7ff0;
'
-OTHER_GOT_SECTIONS='
- .lit8 : { *(.lit8) }
- .lit4 : { *(.lit4) }
-'
+OTHER_SDATA_SECTIONS="
+ .lit8 ${RELOCATING-0} : { *(.lit8) }
+ .lit4 ${RELOCATING-0} : { *(.lit4) }
+"
TEXT_START_SYMBOLS='_ftext = . ;'
DATA_START_SYMBOLS='_fdata = . ;'
OTHER_BSS_SYMBOLS='_fbss = .;'
@@ -27,4 +32,5 @@ OTHER_SECTIONS='
ARCH=mips
MACHINE=
TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=mipself
GENERATE_SHLIB_SCRIPT=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32l4300.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32l4300.sh
index 690de88b3aa..865792af83a 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32l4300.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32l4300.sh
@@ -1,29 +1,4 @@
-SCRIPT_NAME=elf
+. ${srcdir}/emulparams/elf32b4300.sh
OUTPUT_FORMAT="elf32-littlemips"
BIG_OUTPUT_FORMAT="elf32-bigmips"
LITTLE_OUTPUT_FORMAT="elf32-littlemips"
-TEXT_START_ADDR=0xa0020000
-MAXPAGESIZE=0x40000
-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 = .;'
-EXECUTABLE_SYMBOLS='_DYNAMIC_LINK = 0;'
-OTHER_SECTIONS='
- .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
- .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
-'
-ARCH=mips
-MACHINE=
-TEMPLATE_NAME=elf32
-GENERATE_SHLIB_SCRIPT=yes
-DYNAMIC_LINK=false
-EMBEDDED=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32lmip.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32lmip.sh
index 23312f44aca..14d4ded7f9c 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32lmip.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32lmip.sh
@@ -1,30 +1,7 @@
-SCRIPT_NAME=elf
+# If you change this file, please also look at files which source this one:
+# elf32elmip.sh elf32lsmip.sh
+
+. ${srcdir}/emulparams/elf32bmip.sh
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
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf32lppc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32lppc.sh
index bc9125d80d3..18cce4898ee 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32lppc.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32lppc.sh
@@ -1,18 +1,5 @@
-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
+# If you change this file, please also look at files which source this one:
+# elf32lppcsim.sh
+
+. ${srcdir}/emulparams/elf32ppc.sh
OUTPUT_FORMAT="elf32-powerpcle"
-TEXT_START_ADDR=0x01800000
-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/elf32ppc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh
index 75c9c97bc73..d2d704135a5 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ppc.sh
@@ -1,23 +1,39 @@
+# If you change this file, please also look at files which source this one:
+# elf32lppc.sh elf32ppclinux.sh elf32ppcsim.sh
+
TEMPLATE_NAME=elf32
-# If you change this, please also look at:
-# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh
+EXTRA_EM_FILE=ppc32elf
GENERATE_SHLIB_SCRIPT=yes
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-powerpc"
TEXT_START_ADDR=0x01800000
MAXPAGESIZE=0x10000
-ARCH=powerpc
+ARCH=powerpc:common
MACHINE=
BSS_PLT=
-PAD_RO=
-RODATA_PADSIZE=${MAXPAGESIZE}
-RODATA_ALIGN=". = ALIGN(${RODATA_PADSIZE}) + (. & (${RODATA_PADSIZE} - 1))"
-PAD_GOT=
-PAD_PLT=
EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);'
OTHER_BSS_END_SYMBOLS='__end = .;'
-OTHER_READWRITE_SECTIONS='
- .fixup : { *(.fixup) }
- .got1 : { *(.got1) }
- .got2 : { *(.got2) }
-'
+OTHER_READWRITE_SECTIONS="
+ .fixup ${RELOCATING-0} : { *(.fixup) }
+ .got1 ${RELOCATING-0} : { *(.got1) }
+ .got2 ${RELOCATING-0} : { *(.got2) }
+"
+OTHER_GOT_RELOC_SECTIONS="
+ .rela.got1 ${RELOCATING-0} : { *(.rela.got1) }
+ .rela.got2 ${RELOCATING-0} : { *(.rela.got2) }
+"
+
+# 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/elf32ppc_obsd.sh b/gnu/usr.bin/binutils/ld/emulparams/elf32ppc_obsd.sh
new file mode 100644
index 00000000000..63d838343a6
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf32ppc_obsd.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/elf32ppc.sh
+. ${srcdir}/emulparams/elf_obsd.sh
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh
index fe6e88163a5..ab3eec0ec60 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc.sh
@@ -3,16 +3,13 @@ ELFSIZE=64
TEMPLATE_NAME=elf32
OUTPUT_FORMAT="elf64-sparc"
MAXPAGESIZE=0x100000
+COMMONPAGESIZE=0x2000
ARCH="sparc:v9"
MACHINE=
DATA_PLT=
-PAD_RO=
-RODATA_PADSIZE=${MAXPAGESIZE}
-RODATA_ALIGN=". = ALIGN(${RODATA_PADSIZE}) + (. & (${RODATA_PADSIZE} - 1))"
-PAD_GOT=
-PAD_PLT=
GENERATE_SHLIB_SCRIPT=yes
NOP=0x01000000
+NO_SMALL_DATA=yes
case "$target" in
sparc*-solaris*)
@@ -25,36 +22,29 @@ case "$target" in
;;
esac
-if [ "x${host}" = "x${target}" ]; then
+# Treat a host that matches the target with the possible exception of "64"
+# and "v7", "v8", "v9" in the name as if it were native.
+if test `echo "$host" | sed -e 's/64//;s/v[789]//'` \
+ = `echo "$target" | sed -e 's/64//;s/v[789]//'`; then
case " $EMULATION_LIBPATH " in
*" ${EMULATION_NAME} "*)
- # Native, and default or emulation requesting LIB_PATH.
-
- # Linux and Solaris modify the default library search path
- # to first include a 64-bit specific directory. It's put
- # in slightly different places on the two systems.
- case "$target" in
- sparc*-linux*)
- suffix=64 ;;
- sparc*-solaris*)
- suffix=/sparcv9 ;;
- esac
-
- if [ -n "${suffix}" ]; then
-
- LIB_PATH=/lib${suffix}:/lib
- LIB_PATH=${LIB_PATH}:/usr/lib${suffix}:/usr/lib
- if [ -n "${NATIVE_LIB_DIRS}" ]; then
- LIB_PATH=${LIB_PATH}:`echo ${NATIVE_LIB_DIRS} | sed s_:_${suffix}:_g`${suffix}:${NATIVE_LIB_DIRS}
- fi
- if [ "${libdir}" != /usr/lib ]; then
- LIB_PATH=${LIB_PATH}:${libdir}${suffix}:${libdir}
- fi
- if [ "${libdir}" != /usr/local/lib ]; then
- LIB_PATH=${LIB_PATH}:/usr/local/lib${suffix}:/usr/local/lib
- fi
-
- fi
- ;;
+ NATIVE=yes
+ ;;
esac
fi
+
+# Linux and Solaris modify the default library search path
+# to first include a 64-bit specific directory. It's put
+# in slightly different places on the two systems.
+# Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first
+# on Linux and /lib/sparcv9, /usr/lib/sparcv9 etc. on Solaris.
+case "$EMULATION_NAME" in
+ *64*)
+ case "$target" in
+ sparc*-linux*)
+ LIBPATH_SUFFIX=64 ;;
+ sparc*-solaris*)
+ LIBPATH_SUFFIX=/sparcv9 ;;
+ esac
+ ;;
+esac
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc_obsd.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc_obsd.sh
new file mode 100644
index 00000000000..465f473ad99
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64_sparc_obsd.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/elf64_sparc.sh
+. ${srcdir}/emulparams/elf_obsd.sh
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64alpha.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64alpha.sh
index 9755ca7bf08..2d16e9caba6 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf64alpha.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64alpha.sh
@@ -2,70 +2,19 @@ ENTRY=_start
SCRIPT_NAME=elf
ELFSIZE=64
TEMPLATE_NAME=elf32
+EXTRA_EM_FILE=alphaelf
OUTPUT_FORMAT="elf64-alpha"
TEXT_START_ADDR="0x120000000"
MAXPAGESIZE=0x10000
+COMMONPAGESIZE=0x2000
NONPAGED_TEXT_START_ADDR="0x120000000"
ARCH=alpha
MACHINE=
GENERATE_SHLIB_SCRIPT=yes
DATA_PLT=
-PAD_RO=
-RODATA_PADSIZE=${MAXPAGESIZE}
-RODATA_ALIGN=". = ALIGN(${RODATA_PADSIZE}) + (. & (${RODATA_PADSIZE} - 1))"
-PAD_GOT=
-PAD_PLT=
-NOP=0x47ff041f
+# Note that the number is always big-endian, thus we have to
+# reverse the digit string.
+NOP=0x0000fe2f1f04ff47 # unop; nop
-OTHER_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
-
-# This code gets inserted into the generic elf32.sc linker script
-# and allows us to define our own command line switches.
-PARSE_AND_LIST_PROLOGUE='
-#define OPTION_TASO 300
-/* Set the start address as in the Tru64 ld */
-#define ALPHA_TEXT_START_32BIT 0x12000000
-
-static int elf64alpha_32bit = 0;
-
-struct ld_emulation_xfer_struct ld_elf64alpha_emulation;
-static void gld_elf64alpha_finish ();
-'
-
-PARSE_AND_LIST_LONGOPTS='
- {"taso", no_argument, NULL, OPTION_TASO},
-'
-
-PARSE_AND_LIST_OPTIONS='
- fprintf (file, _(" -taso\t\t\tLoad executable in the lower 31-bit addressable\n"));
- fprintf (file, _("\t\t\t virtual address range\n"));
-'
-
-PARSE_AND_LIST_ARGS_CASES='
- case EOF:
- if (elf64alpha_32bit && !link_info.shared && !link_info.relocateable)
- {
- lang_section_start (".interp",
- exp_binop ('\''+'\'',
- exp_intop (ALPHA_TEXT_START_32BIT),
- exp_nameop (SIZEOF_HEADERS, NULL)));
- ld_elf64alpha_emulation.finish = gld_elf64alpha_finish;
- }
- return 0;
-
- case OPTION_TASO:
- elf64alpha_32bit = 1;
- break;
-'
-
-PARSE_AND_LIST_EPILOGUE='
-#include "elf/internal.h"
-#include "elf/alpha.h"
-#include "elf-bfd.h"
-
-static void
-gld_elf64alpha_finish()
-{
- elf_elfheader (output_bfd)->e_flags |= EF_ALPHA_32BIT;
-}
-'
+OTHER_READONLY_SECTIONS="
+ .reginfo ${RELOCATING-0} : { *(.reginfo) }"
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf64alpha_obsd.sh b/gnu/usr.bin/binutils/ld/emulparams/elf64alpha_obsd.sh
new file mode 100644
index 00000000000..d41f5e7814a
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf64alpha_obsd.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/elf64alpha.sh
+. ${srcdir}/emulparams/elf_obsd.sh
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh
index 96eace8c901..f1b8522fe6f 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf_i386.sh
@@ -1,16 +1,12 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-i386"
-TEXT_START_ADDR=0x1C000000
+TEXT_START_ADDR=0x08048000
MAXPAGESIZE=0x1000
+COMMONPAGESIZE=0x1000
NONPAGED_TEXT_START_ADDR=0x08048000
ARCH=i386
MACHINE=
-NOP=0x9090
-PAD_RO=
-RODATA_PADSIZE=0x20000000
-RODATA_ALIGN=". = ALIGN(${RODATA_PADSIZE})"
-RODATA_ALIGN_ADD="${TEXT_START_ADDR}"
-
-PAD_GOT=
+NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
+NO_SMALL_DATA=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_i386_obsd.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_i386_obsd.sh
new file mode 100644
index 00000000000..f3449fe290a
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf_i386_obsd.sh
@@ -0,0 +1,10 @@
+. ${srcdir}/emulparams/elf_i386.sh
+. ${srcdir}/emulparams/elf_obsd.sh
+
+TEXT_START_ADDR=0x1C000000
+
+RODATA_PADSIZE=0x20000000
+RODATA_ALIGN=". = ALIGN(${RODATA_PADSIZE})"
+RODATA_ALIGN_ADD="${TEXT_START_ADDR}"
+
+unset PAD_PLT
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_obsd.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_obsd.sh
new file mode 100644
index 00000000000..84b76462a78
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf_obsd.sh
@@ -0,0 +1,7 @@
+LIB_PATH=/usr/lib
+
+PAD_RO=
+RODATA_PADSIZE=${MAXPAGESIZE}
+RODATA_ALIGN=". = ALIGN(${RODATA_PADSIZE}) + (. & (${RODATA_PADSIZE} - 1))"
+PAD_GOT=
+PAD_PLT=
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64.sh
index 8a5a4b22df3..61e8f29f94f 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64.sh
@@ -3,17 +3,28 @@ ELFSIZE=64
OUTPUT_FORMAT="elf64-x86-64"
TEXT_START_ADDR=0x400000
MAXPAGESIZE=0x100000
+COMMONPAGESIZE=0x1000
NONPAGED_TEXT_START_ADDR=0x400000
-ARCH=i386
+ARCH="i386:x86-64"
MACHINE=
-NOP=0x9090
-LIB_PATH=/usr/lib
-
-PAD_GOT=
-PAD_PLT=
-PAD_RO=
-RODATA_PADSIZE=${MAXPAGESIZE}
-RODATA_ALIGN=". = ALIGN(${RODATA_PADSIZE}) + (. & (${RODATA_PADSIZE} - 1))"
-
+NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
+NO_SMALL_DATA=yes
+
+if [ "x${host}" = "x${target}" ]; then
+ case " $EMULATION_LIBPATH " in
+ *" ${EMULATION_NAME} "*)
+ NATIVE=yes
+ esac
+fi
+
+# Linux modify the default library search path to first include
+# a 64-bit specific directory.
+case "$target" in
+ x86_64*-linux*)
+ case "$EMULATION_NAME" in
+ *64*) LIBPATH_SUFFIX=64 ;;
+ esac
+ ;;
+esac
diff --git a/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64_obsd.sh b/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64_obsd.sh
new file mode 100644
index 00000000000..3689dad903f
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/elf_x86_64_obsd.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/elf_x86_64.sh
+. ${srcdir}/emulparams/elf_obsd.sh
diff --git a/gnu/usr.bin/binutils/ld/emulparams/hppaobsd.sh b/gnu/usr.bin/binutils/ld/emulparams/hppaobsd.sh
index da4ee15ca44..0bb50770ea9 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/hppaobsd.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/hppaobsd.sh
@@ -1,21 +1,23 @@
+. ${srcdir}/emulparams/hppaelf.sh
+
+#override hppaelf.sh
SCRIPT_NAME=elf
ELFSIZE=32
OUTPUT_FORMAT="elf32-hppa"
-TEXT_START_ADDR=0x1000
-TARGET_PAGE_SIZE=0x1000
+
+# other necessary defines, similar but not the same as linux.
MAXPAGESIZE=0x1000
-ARCH=hppa
-MACHINE=hppa1.1 # We use 1.1 specific features.
-NOP=0x08000240
ENTRY="__start"
-OTHER_READONLY_SECTIONS='.PARISC.unwind : { *(.PARISC.unwind) } '
+MACHINE=hppa1.1 # We use 1.1 specific features.
+OTHER_READONLY_SECTIONS=".PARISC.unwind ${RELOCATING-0} : { *(.PARISC.unwind) }"
DATA_START_SYMBOLS='PROVIDE ($global$ = .);'
DATA_PLT=
-PAD_RO=
-RODATA_PADSIZE=${MAXPAGESIZE}
-RODATA_ALIGN=". = ALIGN(${RODATA_PADSIZE}) + (. & (${RODATA_PADSIZE} - 1))"
-PAD_GOT=
-PAD_PLT=
GENERATE_SHLIB_SCRIPT=yes
-TEMPLATE_NAME=elf32
-EXTRA_EM_FILE=hppaelf
+
+. ${srcdir}/emulparams/elf_obsd.sh
+
+case "${target}" in
+hppa-*-openbsd3.2)
+ unset PAD_RO RODATA_PADSIZE RODATA_ALIGN PAD_GOT PAD_PLT ;;
+esac
+
diff --git a/gnu/usr.bin/binutils/ld/emulparams/i386moss.sh b/gnu/usr.bin/binutils/ld/emulparams/i386moss.sh
index a5e0e05eb22..eece4473976 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/i386moss.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/i386moss.sh
@@ -5,6 +5,6 @@ MAXPAGESIZE=0x1000
NONPAGED_TEXT_START_ADDR=0x00002000
ARCH=i386
MACHINE=
-NOP=0x9090
+NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/i386nw.sh b/gnu/usr.bin/binutils/ld/emulparams/i386nw.sh
index e70ed678f3e..621b4755b8b 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/i386nw.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/i386nw.sh
@@ -4,6 +4,6 @@ TEXT_START_ADDR=0x08000000
MAXPAGESIZE=0x1000
NONPAGED_TEXT_START_ADDR=0x08000000
ARCH=i386
-NOP=0x9090
+NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/i386obsd.sh b/gnu/usr.bin/binutils/ld/emulparams/i386obsd.sh
new file mode 100644
index 00000000000..88afe6b851d
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/i386obsd.sh
@@ -0,0 +1,8 @@
+SCRIPT_NAME=aout
+TEXT_START_ADDR=0x1020
+OUTPUT_FORMAT="a.out-i386-netbsd"
+TARGET_PAGE_SIZE=0x1000
+ARCH=i386
+EXECUTABLE_SYMBOLS='__DYNAMIC = 0;'
+
+LIB_PATH=/usr/lib
diff --git a/gnu/usr.bin/binutils/ld/emulparams/m68kelf.sh b/gnu/usr.bin/binutils/ld/emulparams/m68kelf.sh
index a27f63cff5c..b784a3ca54a 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/m68kelf.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/m68kelf.sh
@@ -5,7 +5,8 @@ MAXPAGESIZE=0x2000
NONPAGED_TEXT_START_ADDR=${TEXT_START_ADDR}
ARCH=m68k
MACHINE=
-NOP=0x4e75
+NOP=0x4e754e75
TEMPLATE_NAME=elf32
EXTRA_EM_FILE=m68kelf
GENERATE_SHLIB_SCRIPT=yes
+NO_SMALL_DATA=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/m68kobsd.sh b/gnu/usr.bin/binutils/ld/emulparams/m68kobsd.sh
new file mode 100644
index 00000000000..55f5b2d8c8c
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/m68kobsd.sh
@@ -0,0 +1,9 @@
+SCRIPT_NAME=aout
+TEXT_START_ADDR=0x2020
+NONPAGED_TEXT_START_ADDR=0x2000
+OUTPUT_FORMAT="a.out-m68k-netbsd"
+TARGET_PAGE_SIZE=0x2000
+ARCH=m68k
+EXECUTABLE_SYMBOLS='__DYNAMIC = 0;'
+
+LIB_PATH=/usr/lib
diff --git a/gnu/usr.bin/binutils/ld/emulparams/mipseb_obsd.sh b/gnu/usr.bin/binutils/ld/emulparams/mipseb_obsd.sh
deleted file mode 100644
index 25cf9418cf3..00000000000
--- a/gnu/usr.bin/binutils/ld/emulparams/mipseb_obsd.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-SCRIPT_NAME=elfmips
-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
-OTHER_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
-OTHER_GOT_SYMBOLS='
- _gp = ALIGN(16) + 0x7ff0;
-'
-OTHER_READWRITE_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
-TEMPLATE_NAME=elfobsd
-GENERATE_SHLIB_SCRIPT=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/mipsel_obsd.sh b/gnu/usr.bin/binutils/ld/emulparams/mipsel_obsd.sh
deleted file mode 100644
index a6ca46dfa4e..00000000000
--- a/gnu/usr.bin/binutils/ld/emulparams/mipsel_obsd.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-SCRIPT_NAME=elfmips
-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
-OTHER_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
-OTHER_GOT_SYMBOLS='
- _gp = ALIGN(16) + 0x7ff0;
-'
-OTHER_READWRITE_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
-TEMPLATE_NAME=elfobsd
-GENERATE_SHLIB_SCRIPT=yes
diff --git a/gnu/usr.bin/binutils/ld/emulparams/ns32knbsd.sh b/gnu/usr.bin/binutils/ld/emulparams/ns32knbsd.sh
index 1c4fdf3449c..2ded301471f 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/ns32knbsd.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/ns32knbsd.sh
@@ -3,3 +3,6 @@ TEXT_START_ADDR=0x1020
OUTPUT_FORMAT="a.out-ns32k-netbsd"
TARGET_PAGE_SIZE=0x1000
ARCH=ns32k
+EXECUTABLE_SYMBOLS='__DYNAMIC = 0;'
+NONPAGED_TEXT_START_ADDR=0x1000
+EXTRA_EM_FILE=netbsd
diff --git a/gnu/usr.bin/binutils/ld/emulparams/ppcmacos.sh b/gnu/usr.bin/binutils/ld/emulparams/ppcmacos.sh
index b6b800c2c6c..9f02af404f0 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/ppcmacos.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/ppcmacos.sh
@@ -1,4 +1,6 @@
TEMPLATE_NAME=aix
SCRIPT_NAME=aix
OUTPUT_FORMAT="xcoff-powermac"
+OUTPUT_FORMAT_32BIT="xcoff-powermac"
+OUTPUT_FORMAT_64BIT="xcoff-powermac"
ARCH=powerpc
diff --git a/gnu/usr.bin/binutils/ld/emulparams/sh.sh b/gnu/usr.bin/binutils/ld/emulparams/sh.sh
index 38844fb18ee..52d14435609 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/sh.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/sh.sh
@@ -1,3 +1,6 @@
+# If you change this file, please also look at files which source this one:
+# shl.sh
+
SCRIPT_NAME=sh
OUTPUT_FORMAT="coff-sh"
TEXT_START_ADDR=0x8000
diff --git a/gnu/usr.bin/binutils/ld/emulparams/shl.sh b/gnu/usr.bin/binutils/ld/emulparams/shl.sh
index 360aac8905c..5fbb165c2bc 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/shl.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/shl.sh
@@ -1,5 +1,2 @@
-SCRIPT_NAME=sh
+. ${srcdir}/emulparams/sh.sh
OUTPUT_FORMAT="coff-shl"
-TEXT_START_ADDR=0x8000
-TARGET_PAGE_SIZE=128
-ARCH=sh
diff --git a/gnu/usr.bin/binutils/ld/emulparams/sparcobsd.sh b/gnu/usr.bin/binutils/ld/emulparams/sparcobsd.sh
new file mode 100644
index 00000000000..a45fadc51b1
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/emulparams/sparcobsd.sh
@@ -0,0 +1,7 @@
+SCRIPT_NAME=aout
+TEXT_START_ADDR=0x1020
+OUTPUT_FORMAT="a.out-sparc-netbsd"
+TARGET_PAGE_SIZE=0x1000
+ARCH=sparc
+
+LIB_PATH=/usr/lib
diff --git a/gnu/usr.bin/binutils/ld/emulparams/vax.sh b/gnu/usr.bin/binutils/ld/emulparams/vax.sh
index 97854831041..1bd1c107d2f 100644
--- a/gnu/usr.bin/binutils/ld/emulparams/vax.sh
+++ b/gnu/usr.bin/binutils/ld/emulparams/vax.sh
@@ -1,5 +1,5 @@
SCRIPT_NAME=aout
-OUTPUT_FORMAT="a.out"
+OUTPUT_FORMAT="a.out-vax-bsd"
TEXT_START_ADDR=0
TARGET_PAGE_SIZE=1024
ARCH=vax