aboutsummaryrefslogtreecommitdiff
path: root/ld/emulparams
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-11-22 09:08:05 +0000
committerAlan Modra <amodra@gmail.com>2001-11-22 09:08:05 +0000
commit465bc359f918c08b43affd19c922fa3d6cde05a6 (patch)
tree4b06651de07e169e149e0ae65f0d0f7cb70e4ea1 /ld/emulparams
parent172d914f223d4c00f392a4c2da09dc3645de1ccc (diff)
downloadgdb-465bc359f918c08b43affd19c922fa3d6cde05a6.zip
gdb-465bc359f918c08b43affd19c922fa3d6cde05a6.tar.gz
gdb-465bc359f918c08b43affd19c922fa3d6cde05a6.tar.bz2
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Define.
(config.status): Delete rule. Add extra dependencies to cover sourced emulparams files. * Makefile.in: Regenerate. * scripttempl/elf.sc: Order <section>, <section>.* and corresponding linkonce sections as seen in input files. Formatting fixes. Zero vma of all sections if not relocating. (STACK): Define and insert if STACK_ADDR defined. (OTHER_RELOCATING_SECTIONS): Delete. (OTHER_END_SYMBOLS): Define. (OTHER_READONLY_SECTIONS): Always insert, not just when relocating. (OTHER_READWRITE_SECTIONS): Likewise. (OTHER_GOT_SECTIONS): Likewise. (OTHER_SDATA_SECTIONS): Likewise. (OTHER_BSS_SECTIONS): Likewise. * scripttempl/elfi370.sc (OTHER_READONLY_SECTIONS): Likewise. (OTHER_READWRITE_SECTIONS): Likewise. * scripttempl/nw.sc (OTHER_READONLY_SECTIONS): Likewise. (OTHER_READWRITE_SECTIONS): Likewise * emulparams/armelf.sh (OTHER_RELOCATING_SECTIONS): Delete. (STACK_ADDR): Define. * emulparams/armelf_oabi.sh: As for armelf.sh. * emulparams/elf32mcore.sh: As for armelf.sh. * emulparams/h8300elf.sh: As for armelf.sh. * emulparams/mn10200.sh: As for armelf.sh. * emulparams/shelf.sh: As for armelf.sh. * emulparams/elf32fr30.sh (OTHER_RELOCATING_SECTIONS): Delete. (OTHER_END_SYMBOLS): Define. * emulparams/m32relf.sh: As for elf32fr30.sh. * emulparams/h8300helf.sh: As for elf32fr30.sh. * emulparams/h8300self.sh: As for elf32fr30.sh. * emulparams/criself.sh (OTHER_READONLY_SECTIONS): Protect symbol defines with RELOCATING test. (OTHER_SDATA_SECTIONS): Likewise. (OTHER_RELOCATING_SECTIONS): Delete, replacing with.. (OTHER_END_SYMBOLS): ..this. * emulparams/crislinux.sh: As for criself.sh. * emulparams/elf32bmipn32.sh (OTHER_SDATA_SECTIONS): Zero vma if not relocating. (OTHER_RELOCATING_SECTIONS): Delete, replacing with.. (OTHER_SECTIONS): ..this. Zero vma if not relocating. Order normal and linkonce sections as seen in input files. * emulparams/elf32bmip.sh (DATA_ADDR): Don't define if EMBEDDED. (TEXT_DYNAMIC): Likewise. (INITIAL_READONLY_SECTIONS): Zero vma if not relocating. (OTHER_SDATA_SECTIONS): Likewise. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Likewise. * emulparams/shlelf_linux.sh (OTHER_READWRITE_SECTIONS): Likewise. * emulparams/elf64alpha.sh (OTHER_READONLY_SECTIONS): Likewise. * emulparams/hppalinux.sh (OTHER_READONLY_SECTIONS): Likewise. * emulparams/elf64_aix.sh (OTHER_GOT_SECTIONS): Likewise. (OTHER_PLT_RELOC_SECTIONS): Likewise. (OTHER_READONLY_SECTIONS): Likewise. Order normal and linkonce sections as seen in input files. * emulparams/elf64_ia64.sh: As for emulparams/elf64_aix.sh. * emulparams/hppa64linux.sh (OTHER_READONLY_SECTIONS): Zero vma if not relocating. (OTHER_READWRITE_SECTIONS, OTHER_BSS_SECTIONS): Likewise. (OTHER_BSS_END_SYMBOLS): Merge from elf64hppa.sh. * emulparams/elf64mmix.sh (OTHER_RELOCATING_SECTIONS): Delete. (OTHER_SECTIONS): Instead, use this.. (OTHER_END_SYMBOLS): ..and this. * emulparams/elf32b4300.sh: Source elf32bmip.sh, remove duplicates. * emulparams/elf32bsmip.sh: Likewise. * emulparams/elf32btsmip.sh: Likewise. * emulparams/elf32ebmip.sh: Likewise. * emulparams/elf32lmip.sh: Likewise. * emulparams/elf32elmip.sh: Source elf32lmip.sh, remove duplicates. * emulparams/elf32lsmip.sh: Likewise. * emulparams/elf32ltsmip.sh: Source elf32btsmip.sh, remove duplicates. * emulparams/elf32l4300.sh: Source elf32b4300.sh, remove duplicates. * emulparams/elf64bmip.sh: Source elf32bmipn32.sh, remove duplicates. * emulparams/elf64btsmip.sh: Likewise. * emulparams/elf64ltsmip.sh: Source elf64btsmip.sh, remove duplicates. * emulparams/elf32lppc.sh: Source elf32ppc.sh, remove duplicates. * emulparams/elf32ppclinux.sh: Likewise. * emulparams/elf32ppcsim.sh: Likewise. * emulparams/elf32lppcsim.sh: Source elf32lppc.sh, remove duplicates. * emulparams/elf64hppa.sh: Source hppa64linux.sh, remove duplicates. * emulparams/h8300helf.sh: Source h8300elf.sh, remove duplicates. * emulparams/h8300self.sh: Likewise. * emulparams/mn10300.sh: Source mn10200.sh, remove duplicates. * emulparams/sh.sh: Comment. * emulparams/shl.sh: Source sh.sh, remove duplicates. * emulparams/shlelf.sh: Source shelf.sh, remove duplicates. * emulparams/shelf_linux.sh: Source shlelf_linux.sh, remove duplicates.
Diffstat (limited to 'ld/emulparams')
-rw-r--r--ld/emulparams/armelf.sh5
-rw-r--r--ld/emulparams/armelf_oabi.sh5
-rw-r--r--ld/emulparams/criself.sh15
-rw-r--r--ld/emulparams/crislinux.sh14
-rw-r--r--ld/emulparams/elf32b4300.sh33
-rw-r--r--ld/emulparams/elf32bmip.sh19
-rwxr-xr-xld/emulparams/elf32bmipn32.sh48
-rw-r--r--ld/emulparams/elf32bsmip.sh31
-rw-r--r--ld/emulparams/elf32btsmip.sh30
-rw-r--r--ld/emulparams/elf32ebmip.sh28
-rw-r--r--ld/emulparams/elf32elmip.sh28
-rwxr-xr-xld/emulparams/elf32fr30.sh2
-rw-r--r--ld/emulparams/elf32l4300.sh27
-rw-r--r--ld/emulparams/elf32lmip.sh31
-rw-r--r--ld/emulparams/elf32lppc.sh21
-rw-r--r--ld/emulparams/elf32lppcsim.sh18
-rw-r--r--ld/emulparams/elf32lsmip.sh31
-rw-r--r--ld/emulparams/elf32ltsmip.sh31
-rw-r--r--ld/emulparams/elf32mcore.sh5
-rw-r--r--ld/emulparams/elf32ppc.sh15
-rw-r--r--ld/emulparams/elf32ppclinux.sh24
-rw-r--r--ld/emulparams/elf32ppcsim.sh18
-rw-r--r--ld/emulparams/elf64_aix.sh11
-rw-r--r--ld/emulparams/elf64_ia64.sh11
-rw-r--r--ld/emulparams/elf64alpha.sh3
-rwxr-xr-xld/emulparams/elf64bmip.sh69
-rw-r--r--ld/emulparams/elf64btsmip.sh31
-rwxr-xr-xld/emulparams/elf64hppa.sh40
-rw-r--r--ld/emulparams/elf64ltsmip.sh42
-rw-r--r--ld/emulparams/elf64mmix.sh6
-rw-r--r--ld/emulparams/h8300elf.sh8
-rw-r--r--ld/emulparams/h8300helf.sh13
-rw-r--r--ld/emulparams/h8300self.sh13
-rw-r--r--ld/emulparams/hppa64linux.sh24
-rw-r--r--ld/emulparams/hppalinux.sh3
-rw-r--r--ld/emulparams/m32relf.sh5
-rw-r--r--ld/emulparams/mn10200.sh9
-rw-r--r--ld/emulparams/mn10300.sh19
-rw-r--r--ld/emulparams/sh.sh3
-rw-r--r--ld/emulparams/shelf.sh5
-rw-r--r--ld/emulparams/shelf_linux.sh14
-rw-r--r--ld/emulparams/shl.sh5
-rw-r--r--ld/emulparams/shlelf.sh17
-rw-r--r--ld/emulparams/shlelf_linux.sh8
44 files changed, 180 insertions, 658 deletions
diff --git a/ld/emulparams/armelf.sh b/ld/emulparams/armelf.sh
index 697bf90..0e8ebc5 100644
--- a/ld/emulparams/armelf.sh
+++ b/ld/emulparams/armelf.sh
@@ -20,6 +20,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/ld/emulparams/armelf_oabi.sh b/ld/emulparams/armelf_oabi.sh
index d568328..f1c967d 100644
--- a/ld/emulparams/armelf_oabi.sh
+++ b/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/ld/emulparams/criself.sh b/ld/emulparams/criself.sh
index 141ab51..f961281 100644
--- a/ld/emulparams/criself.sh
+++ b/ld/emulparams/criself.sh
@@ -32,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_SDATA_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
@@ -95,11 +95,8 @@ 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);"
diff --git a/ld/emulparams/crislinux.sh b/ld/emulparams/crislinux.sh
index e33b462..259670d 100644
--- a/ld/emulparams/crislinux.sh
+++ b/ld/emulparams/crislinux.sh
@@ -22,18 +22,16 @@ MAXPAGESIZE=8192
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_SDATA_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);"
diff --git a/ld/emulparams/elf32b4300.sh b/ld/emulparams/elf32b4300.sh
index 88626a4..4bfdd6e 100644
--- a/ld/emulparams/elf32b4300.sh
+++ b/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_SDATA_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
diff --git a/ld/emulparams/elf32bmip.sh b/ld/emulparams/elf32bmip.sh
index 0c07663..cf2abde 100644
--- a/ld/emulparams/elf32bmip.sh
+++ b/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_SDATA_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 = .;'
diff --git a/ld/emulparams/elf32bmipn32.sh b/ld/emulparams/elf32bmipn32.sh
index b060808..8dc1735 100755
--- a/ld/emulparams/elf32bmipn32.sh
+++ b/ld/emulparams/elf32bmipn32.sh
@@ -1,3 +1,6 @@
+# If you change this file, please also look at files which source this one:
+# elf64bmip.sh elf64btsmip.sh
+
# This is an ELF platform.
SCRIPT_NAME=elf
@@ -17,11 +20,11 @@ ENTRY=__start
OTHER_GOT_SYMBOLS='
_gp = ALIGN(16) + 0x7ff0;
'
-OTHER_SDATA_SECTIONS='
- .lit8 : { *(.lit8) }
- .lit4 : { *(.lit4) }
- .srdata : { *(.srdata) }
-'
+OTHER_SDATA_SECTIONS="
+ .lit8 ${RELOCATING-0} : { *(.lit8) }
+ .lit4 ${RELOCATING-0} : { *(.lit4) }
+ .srdata ${RELOCATING-0} : { *(.srdata) }
+"
# Magic symbols.
TEXT_START_SYMBOLS='_ftext = . ;'
@@ -41,35 +44,28 @@ EXECUTABLE_SYMBOLS="
# segment.
WRITABLE_RODATA=
-OTHER_RELOCATING_SECTIONS='
- .MIPS.events.text :
+OTHER_SECTIONS="
+ .MIPS.events.text ${RELOCATING-0} :
{
- *(.MIPS.events.text)
- *(.MIPS.events.gnu.linkonce.t*)
+ *(.MIPS.events.text${RELOCATING+ .MIPS.events.gnu.linkonce.t*})
}
- .MIPS.content.text :
+ .MIPS.content.text ${RELOCATING-0} :
{
- *(.MIPS.content.text)
- *(.MIPS.content.gnu.linkonce.t*)
+ *(.MIPS.content.text${RELOCATING+ .MIPS.content.gnu.linkonce.t*})
}
- .MIPS.events.data :
+ .MIPS.events.data ${RELOCATING-0} :
{
- *(.MIPS.events.data)
- *(.MIPS.events.gnu.linkonce.d*)
+ *(.MIPS.events.data${RELOCATING+ .MIPS.events.gnu.linkonce.d*})
}
- .MIPS.content.data :
+ .MIPS.content.data ${RELOCATING-0} :
{
- *(.MIPS.content.data)
- *(.MIPS.content.gnu.linkonce.d*)
+ *(.MIPS.content.data${RELOCATING+ .MIPS.content.gnu.linkonce.d*})
}
- .MIPS.events.rodata :
+ .MIPS.events.rodata ${RELOCATING-0} :
{
- *(.MIPS.events.rodata)
- *(.MIPS.events.gnu.linkonce.r*)
+ *(.MIPS.events.rodata${RELOCATING+ .MIPS.events.gnu.linkonce.r*})
}
- .MIPS.content.rodata :
+ .MIPS.content.rodata ${RELOCATING-0} :
{
- *(.MIPS.content.rodata)
- *(.MIPS.content.gnu.linkonce.r*)
- }
-'
+ *(.MIPS.content.rodata${RELOCATING+ .MIPS.content.gnu.linkonce.r*})
+ }"
diff --git a/ld/emulparams/elf32bsmip.sh b/ld/emulparams/elf32bsmip.sh
index 78421d1..5b2939a 100644
--- a/ld/emulparams/elf32bsmip.sh
+++ b/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_SDATA_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/ld/emulparams/elf32btsmip.sh b/ld/emulparams/elf32btsmip.sh
index 9c8e344..5c32c2d 100644
--- a/ld/emulparams/elf32btsmip.sh
+++ b/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_SDATA_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/ld/emulparams/elf32ebmip.sh b/ld/emulparams/elf32ebmip.sh
index 14eb318..704b43e 100644
--- a/ld/emulparams/elf32ebmip.sh
+++ b/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_SDATA_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/ld/emulparams/elf32elmip.sh b/ld/emulparams/elf32elmip.sh
index 865553c..c94e503 100644
--- a/ld/emulparams/elf32elmip.sh
+++ b/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_SDATA_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/ld/emulparams/elf32fr30.sh b/ld/emulparams/elf32fr30.sh
index 53d6a74..cec006c 100755
--- a/ld/emulparams/elf32fr30.sh
+++ b/ld/emulparams/elf32fr30.sh
@@ -7,4 +7,4 @@ MAXPAGESIZE=256
ENTRY=_start
EMBEDDED=yes
NOP=0x9fa09fa0
-OTHER_RELOCATING_SECTIONS='PROVIDE (__stack = 0x200000);'
+OTHER_END_SYMBOLS='PROVIDE (__stack = 0x200000);'
diff --git a/ld/emulparams/elf32l4300.sh b/ld/emulparams/elf32l4300.sh
index 4bd48e8..865792a 100644
--- a/ld/emulparams/elf32l4300.sh
+++ b/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_SDATA_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/ld/emulparams/elf32lmip.sh b/ld/emulparams/elf32lmip.sh
index 99a9dd8..14d4ded 100644
--- a/ld/emulparams/elf32lmip.sh
+++ b/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_SDATA_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/ld/emulparams/elf32lppc.sh b/ld/emulparams/elf32lppc.sh
index bc9125d..18cce48 100644
--- a/ld/emulparams/elf32lppc.sh
+++ b/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/ld/emulparams/elf32lppcsim.sh b/ld/emulparams/elf32lppcsim.sh
index 74959f8..e743852 100644
--- a/ld/emulparams/elf32lppcsim.sh
+++ b/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/ld/emulparams/elf32lsmip.sh b/ld/emulparams/elf32lsmip.sh
index 4f792e2..62e4f98 100644
--- a/ld/emulparams/elf32lsmip.sh
+++ b/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_SDATA_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/ld/emulparams/elf32ltsmip.sh b/ld/emulparams/elf32ltsmip.sh
index 443b98f..4a660f0 100644
--- a/ld/emulparams/elf32ltsmip.sh
+++ b/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_SDATA_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/ld/emulparams/elf32mcore.sh b/ld/emulparams/elf32mcore.sh
index 06b2325..36befc8 100644
--- a/ld/emulparams/elf32mcore.sh
+++ b/ld/emulparams/elf32mcore.sh
@@ -24,9 +24,8 @@ 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/ld/emulparams/elf32ppc.sh b/ld/emulparams/elf32ppc.sh
index 2220810..261e4bf 100644
--- a/ld/emulparams/elf32ppc.sh
+++ b/ld/emulparams/elf32ppc.sh
@@ -1,6 +1,7 @@
+# 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
GENERATE_SHLIB_SCRIPT=yes
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-powerpc"
@@ -11,8 +12,8 @@ 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) }
-'
+OTHER_READWRITE_SECTIONS="
+ .fixup ${RELOCATING-0} : { *(.fixup) }
+ .got1 ${RELOCATING-0} : { *(.got1) }
+ .got2 ${RELOCATING-0} : { *(.got2) }
+"
diff --git a/ld/emulparams/elf32ppclinux.sh b/ld/emulparams/elf32ppclinux.sh
index 7c458a2..5ced00d 100644
--- a/ld/emulparams/elf32ppclinux.sh
+++ b/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/ld/emulparams/elf32ppcsim.sh b/ld/emulparams/elf32ppcsim.sh
index e25a170..c3466cf 100644
--- a/ld/emulparams/elf32ppcsim.sh
+++ b/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/ld/emulparams/elf64_aix.sh b/ld/emulparams/elf64_aix.sh
index af6b63a..23ba731 100644
--- a/ld/emulparams/elf64_aix.sh
+++ b/ld/emulparams/elf64_aix.sh
@@ -10,7 +10,12 @@ TEXT_START_ADDR="0x10000000"
DATA_ADDR="0x20000000 + (. & (${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*) *(.gnu.linkonce.ia64unwi.*) } .IA_64.unwind : { *(.IA_64.unwind*) *(.gnu.linkonce.ia64unw.*) }'
+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/ld/emulparams/elf64_ia64.sh b/ld/emulparams/elf64_ia64.sh
index 2dc7026..0699d3d 100644
--- a/ld/emulparams/elf64_ia64.sh
+++ b/ld/emulparams/elf64_ia64.sh
@@ -11,6 +11,11 @@ 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*) *(.gnu.linkonce.ia64unwi.*) } .IA_64.unwind : { *(.IA_64.unwind*) *(.gnu.linkonce.ia64unw.*) }'
+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/ld/emulparams/elf64alpha.sh b/ld/emulparams/elf64alpha.sh
index f31a38c..e1eaa11 100644
--- a/ld/emulparams/elf64alpha.sh
+++ b/ld/emulparams/elf64alpha.sh
@@ -12,7 +12,8 @@ GENERATE_SHLIB_SCRIPT=yes
DATA_PLT=
NOP=0x47ff041f
-OTHER_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
+OTHER_READONLY_SECTIONS="
+ .reginfo ${RELOCATING-0} : { *(.reginfo) }"
# This code gets inserted into the generic elf32.sc linker script
# and allows us to define our own command line switches.
diff --git a/ld/emulparams/elf64bmip.sh b/ld/emulparams/elf64bmip.sh
index 8610e2b..990fcb6 100755
--- a/ld/emulparams/elf64bmip.sh
+++ b/ld/emulparams/elf64bmip.sh
@@ -1,79 +1,12 @@
-# This is an ELF platform.
-SCRIPT_NAME=elf
-
-# Handle both big- and little-ended 32-bit MIPS objects.
-ARCH=mips
+. ${srcdir}/emulparams/elf32bmipn32.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_SDATA_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;
__elf_header = ${TEXT_START_ADDR};
__program_header_table = ${TEXT_START_ADDR} + 0x40;
"
-
-# There are often dynamic relocations against the .rodata section.
-# Setting DT_TEXTREL in the .dynamic section does not convince the
-# IRIX6 linker to permit relocations against the text segment.
-# 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/ld/emulparams/elf64btsmip.sh b/ld/emulparams/elf64btsmip.sh
index 69edab9..df7566a 100644
--- a/ld/emulparams/elf64btsmip.sh
+++ b/ld/emulparams/elf64btsmip.sh
@@ -1,39 +1,20 @@
-# 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.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
+GENERATE_SHLIB_SCRIPT=yes
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_SDATA_SECTIONS='
- .lit8 : { *(.lit8) }
- .lit4 : { *(.lit4) }
-'
-# Magic symbols.
-TEXT_START_SYMBOLS='_ftext = . ;'
-DATA_START_SYMBOLS='_fdata = . ;'
-OTHER_BSS_SYMBOLS='_fbss = .;'
+unset EXECUTABLE_SYMBOLS
+unset WRITABLE_RODATA
# Magic sections.
INITIAL_READONLY_SECTIONS='.reginfo : { *(.reginfo) }'
diff --git a/ld/emulparams/elf64hppa.sh b/ld/emulparams/elf64hppa.sh
index 402f8ce..8a44179 100755
--- a/ld/emulparams/elf64hppa.sh
+++ b/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
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); 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 : { *(.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/ld/emulparams/elf64ltsmip.sh b/ld/emulparams/elf64ltsmip.sh
index c6d0e57..efd6b7d 100644
--- a/ld/emulparams/elf64ltsmip.sh
+++ b/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_SDATA_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/ld/emulparams/elf64mmix.sh b/ld/emulparams/elf64mmix.sh
index dc4b9e5..c811ce0 100644
--- a/ld/emulparams/elf64mmix.sh
+++ b/ld/emulparams/elf64mmix.sh
@@ -44,17 +44,17 @@ OTHER_TEXT_SECTIONS='
PROVIDE (Main = DEFINED (Main) ? Main : (DEFINED (_start) ? _start : _start.));
'
-OTHER_RELOCATING_SECTIONS='
+OTHER_SECTIONS="
.MMIX.reg_contents :
{
/* Note that this section always has a fixed VMA - that of its
first register * 8. */
*(.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_SECTIONS='PROVIDE (__Stack_start = 0x6000000000000000);'
+OTHER_END_SYMBOLS="PROVIDE (__Stack_start = 0x6000000000000000);"
diff --git a/ld/emulparams/h8300elf.sh b/ld/emulparams/h8300elf.sh
index e3024c6..0617d5b 100644
--- a/ld/emulparams/h8300elf.sh
+++ b/ld/emulparams/h8300elf.sh
@@ -1,3 +1,6 @@
+# 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
@@ -6,7 +9,4 @@ TARGET_PAGE_SIZE=128
ARCH=h8300
TEMPLATE_NAME=elf32
EMBEDDED=yes
-
-OTHER_RELOCATING_SECTIONS='
-.stack 0xfefc : { _stack = .; *(.stack) }
-'
+STACK_ADDR=0xfefc
diff --git a/ld/emulparams/h8300helf.sh b/ld/emulparams/h8300helf.sh
index cf72e1b..1cde35c 100644
--- a/ld/emulparams/h8300helf.sh
+++ b/ld/emulparams/h8300helf.sh
@@ -1,12 +1,3 @@
-SCRIPT_NAME=elf
-OUTPUT_FORMAT="elf32-h8300"
-TEXT_START_ADDR=0x100
-MAXPAGESIZE=2
-TARGET_PAGE_SIZE=128
+. ${srcdir}/emulparams/h8300elf.sh
ARCH="h8300:h8300h"
-TEMPLATE_NAME=elf32
-EMBEDDED=yes
-
-OTHER_RELOCATING_SECTIONS='
-.stack 0x2fefc : { _stack = .; *(.stack) }
-'
+STACK_ADDR=0x2fefc
diff --git a/ld/emulparams/h8300self.sh b/ld/emulparams/h8300self.sh
index 20ed7ca..7539eec 100644
--- a/ld/emulparams/h8300self.sh
+++ b/ld/emulparams/h8300self.sh
@@ -1,12 +1,3 @@
-SCRIPT_NAME=elf
-OUTPUT_FORMAT="elf32-h8300"
-TEXT_START_ADDR=0x100
-MAXPAGESIZE=2
-TARGET_PAGE_SIZE=128
+. ${srcdir}/emulparams/h8300elf.sh
ARCH="h8300:h8300s"
-TEMPLATE_NAME=elf32
-EMBEDDED=yes
-
-OTHER_RELOCATING_SECTIONS='
-.stack 0x2fefc : { _stack = .; *(.stack) }
-'
+STACK_ADDR=0x2fefc
diff --git a/ld/emulparams/hppa64linux.sh b/ld/emulparams/hppa64linux.sh
index 3fe422b..49bcf32 100644
--- a/ld/emulparams/hppa64linux.sh
+++ b/ld/emulparams/hppa64linux.sh
@@ -1,3 +1,6 @@
+# If you change this file, please also look at files which source this one:
+# elf64hppa.sh
+
SCRIPT_NAME=elf
ELFSIZE=64
OUTPUT_FORMAT="elf64-hppa-linux"
@@ -12,18 +15,31 @@ 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) } '
+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 : { *(.opd) } PROVIDE (__gp = .); .plt : { *(.plt) } .dlt : { *(.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 : { *(.hbss) } .tbss : { *(.tbss) }'
+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);'
+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 : { *(.rela.dlt) }'
diff --git a/ld/emulparams/hppalinux.sh b/ld/emulparams/hppalinux.sh
index 0a98298..a4c4904 100644
--- a/ld/emulparams/hppalinux.sh
+++ b/ld/emulparams/hppalinux.sh
@@ -8,7 +8,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/ld/emulparams/m32relf.sh b/ld/emulparams/m32relf.sh
index cd7705a..c67472a 100644
--- a/ld/emulparams/m32relf.sh
+++ b/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/ld/emulparams/mn10200.sh b/ld/emulparams/mn10200.sh
index 6324322..f96224b 100644
--- a/ld/emulparams/mn10200.sh
+++ b/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/ld/emulparams/mn10300.sh b/ld/emulparams/mn10300.sh
index 44a40e5..eec2f84 100644
--- a/ld/emulparams/mn10300.sh
+++ b/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/ld/emulparams/sh.sh b/ld/emulparams/sh.sh
index 38844fb..52d1443 100644
--- a/ld/emulparams/sh.sh
+++ b/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/ld/emulparams/shelf.sh b/ld/emulparams/shelf.sh
index 95db587..d360022 100644
--- a/ld/emulparams/shelf.sh
+++ b/ld/emulparams/shelf.sh
@@ -1,3 +1,6 @@
+# If you change this file, please also look at files which source this one:
+# shlelf.sh
+
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-sh"
TEXT_START_ADDR=0x1000
@@ -14,4 +17,4 @@ CTOR_START='___ctors = .;'
CTOR_END='___ctors_end = .;'
DTOR_START='___dtors = .;'
DTOR_END='___dtors_end = .;'
-OTHER_RELOCATING_SECTIONS='.stack 0x30000 : { _stack = .; *(.stack) }'
+STACK_ADDR=0x30000
diff --git a/ld/emulparams/shelf_linux.sh b/ld/emulparams/shelf_linux.sh
index d7b7631..b841bef 100644
--- a/ld/emulparams/shelf_linux.sh
+++ b/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/ld/emulparams/shl.sh b/ld/emulparams/shl.sh
index 360aac8..5fbb165 100644
--- a/ld/emulparams/shl.sh
+++ b/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/ld/emulparams/shlelf.sh b/ld/emulparams/shlelf.sh
index bb27f86..e19678b 100644
--- a/ld/emulparams/shlelf.sh
+++ b/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/ld/emulparams/shlelf_linux.sh b/ld/emulparams/shlelf_linux.sh
index 191def7..875b2f3 100644
--- a/ld/emulparams/shlelf_linux.sh
+++ b/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) }"