aboutsummaryrefslogtreecommitdiff
path: root/ld/emulparams
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2016-03-29 15:57:40 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2016-04-05 23:08:28 +0100
commit9a5f28ae286634f2d7d381b7d234abc2f3aa5548 (patch)
treefca3f4e50e7c9996f20f45f2bcdd76dca8c9b0fc /ld/emulparams
parent820f03ffe027367f275e9debb5f3f3376820ab37 (diff)
downloadgdb-9a5f28ae286634f2d7d381b7d234abc2f3aa5548.zip
gdb-9a5f28ae286634f2d7d381b7d234abc2f3aa5548.tar.gz
gdb-9a5f28ae286634f2d7d381b7d234abc2f3aa5548.tar.bz2
ld/arc: Fix linker for big-endian arc targets
This aims to bring the linker for big-endian arc targets into line with the linker for (the default) little endian arc targets. The bulk of the changes are to extend the target pattern in the test files from 'arc-*...' to 'arc*-*...' and so match both big and little endian arc targets. In the ld/emulparams/ directory the existing scripts checked for a variable ARC_ENDIAN to switch between big and little endian targets, however, this variable is never set up. So, a new script snippet is introduced which sets up ARC_ENDIAN based on the value of target, this snippet is then included from all of the existing arc scripts. The existing big-endian variants of all the scripts, which existed, but were never used, are deleted in this commit. ld/ChangeLog: * emulparams/arc-endianness.sh: New file. * emulparams/arcebelf.sh: Deleted. * emulparams/arcebelf_prof.sh: Deleted. * emulparams/arceblinux.sh: Deleted. * emulparams/arceblinux_prof.sh: Deleted. * emulparams/arcelf.sh: Include arc-endinness.sh. * emulparams/arcelf_prof.sh: Include arc-endinness.sh. * emulparams/arclinux.sh: Include arc-endinness.sh. * emulparams/arclinux_prof.sh: Include arc-endinness.sh. * emulparams/arcv2elf.sh: Include arc-endinness.sh. * emulparams/arcv2elfx.sh: Include arc-endinness.sh. * testsuite/ld-elf/compressed1d.d: Update pattern for big and little endian arc targets. * testsuite/ld-elf/eh-frame-hdr.d: Likewise. * testsuite/ld-elf/group1.d: Likewise. * testsuite/ld-elf/group3b.d: Likewise. * testsuite/ld-elf/group8a.d: Likewise. * testsuite/ld-elf/group8b.d: Likewise. * testsuite/ld-elf/group9a.d: Likewise. * testsuite/ld-elf/group9b.d: Likewise. * testsuite/ld-elf/linkonce2.d: Likewise. * testsuite/ld-elf/pr12851.d: Likewise. * testsuite/ld-elf/pr12975.d: Likewise. * testsuite/ld-elf/pr13177.d: Likewise. * testsuite/ld-elf/pr13195.d: Likewise. * testsuite/ld-elf/pr17615.d: Likewise. * testsuite/ld-elf/pr19162.d: Likewise. * testsuite/ld-elf/sec64k.exp: Likewise. * testsuite/lib/ld-lib.exp: Likewise.
Diffstat (limited to 'ld/emulparams')
-rw-r--r--ld/emulparams/arc-endianness.sh10
-rw-r--r--ld/emulparams/arcebelf.sh15
-rw-r--r--ld/emulparams/arcebelf_prof.sh21
-rw-r--r--ld/emulparams/arceblinux.sh17
-rw-r--r--ld/emulparams/arceblinux_prof.sh23
-rw-r--r--ld/emulparams/arcelf.sh1
-rw-r--r--ld/emulparams/arcelf_prof.sh1
-rw-r--r--ld/emulparams/arclinux.sh1
-rw-r--r--ld/emulparams/arclinux_prof.sh1
-rw-r--r--ld/emulparams/arcv2elf.sh1
-rw-r--r--ld/emulparams/arcv2elfx.sh1
11 files changed, 16 insertions, 76 deletions
diff --git a/ld/emulparams/arc-endianness.sh b/ld/emulparams/arc-endianness.sh
new file mode 100644
index 0000000..4d6158b
--- /dev/null
+++ b/ld/emulparams/arc-endianness.sh
@@ -0,0 +1,10 @@
+case ${target} in
+ arceb-*)
+ ARC_ENDIAN="big"
+ ;;
+ arc-*)
+ ARC_ENDIAN="little"
+ ;;
+ *)
+ exit 1
+esac
diff --git a/ld/emulparams/arcebelf.sh b/ld/emulparams/arcebelf.sh
deleted file mode 100644
index 994605e..0000000
--- a/ld/emulparams/arcebelf.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-SCRIPT_NAME=elfarc
-TEMPLATE_NAME=elf32
-OUTPUT_FORMAT="elf32-bigarc"
-LITTLE_OUTPUT_FORMAT="elf32-littlearc"
-BIG_OUTPUT_FORMAT="elf32-bigarc"
-# leave room for vector table, 32 vectors * 8 bytes
-TEXT_START_ADDR=0x100
-MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
-#NONPAGED_TEXT_START_ADDR=0x0
-ARCH=arc
-MACHINE=
-ENTRY=__start
-SDATA_START_SYMBOLS='__SDATA_BEGIN__ = .;'
-OTHER_SECTIONS="/DISCARD/ : { *(.__arc_profile_*) }"
-EMBEDDED=yes
diff --git a/ld/emulparams/arcebelf_prof.sh b/ld/emulparams/arcebelf_prof.sh
deleted file mode 100644
index 1bd0531..0000000
--- a/ld/emulparams/arcebelf_prof.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-SCRIPT_NAME=elfarc
-TEMPLATE_NAME=elf32
-OUTPUT_FORMAT="elf32-bigarc"
-LITTLE_OUTPUT_FORMAT="elf32-littlearc"
-BIG_OUTPUT_FORMAT="elf32-bigarc"
-# leave room for vector table, 32 vectors * 8 bytes
-TEXT_START_ADDR=0x100
-MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
-#NONPAGED_TEXT_START_ADDR=0x0
-ARCH=arc
-MACHINE=
-ENTRY=__start
-SDATA_START_SYMBOLS='__SDATA_BEGIN__ = .;'
-OTHER_READONLY_SECTIONS="
- .__arc_profile_desc ${RELOCATING-0} : { *(.__arc_profile_desc) }
- .__arc_profile_forward ${RELOCATING-0} : { *(.__arc_profile_forward) }
-"
-OTHER_BSS_SECTIONS="
- .__arc_profile_counters ${RELOCATING-0} : { *(.__arc_profile_counters) }
-"
-EMBEDDED=yes
diff --git a/ld/emulparams/arceblinux.sh b/ld/emulparams/arceblinux.sh
deleted file mode 100644
index 54fd7a9..0000000
--- a/ld/emulparams/arceblinux.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-SCRIPT_NAME=arclinux
-OUTPUT_FORMAT="elf32-bigarc"
-LITTLE_OUTPUT_FORMAT="elf32-littlearc"
-BIG_OUTPUT_FORMAT="elf32-bigarc"
-TEXT_START_ADDR=0x10000
-MAXPAGESIZE=0x2000
-COMMONPAGESIZE=0x2000
-NONPAGED_TEXT_START_ADDR=0x10000
-ARCH=arc
-MACHINE=
-ENTRY=__start
-TEMPLATE_NAME=arclinux
-TEMPLATE_NAME=elf32
-EXTRA_EM_FILE=arclinux
-GENERATE_SHLIB_SCRIPT=yes
-SDATA_START_SYMBOLS='__SDATA_BEGIN__ = .;'
-OTHER_SECTIONS="/DISCARD/ : { *(.__arc_profile_*) }"
diff --git a/ld/emulparams/arceblinux_prof.sh b/ld/emulparams/arceblinux_prof.sh
deleted file mode 100644
index 3b1ccdd..0000000
--- a/ld/emulparams/arceblinux_prof.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-SCRIPT_NAME=arclinux
-OUTPUT_FORMAT="elf32-bigarc"
-LITTLE_OUTPUT_FORMAT="elf32-littlearc"
-BIG_OUTPUT_FORMAT="elf32-bigarc"
-TEXT_START_ADDR=0x10000
-MAXPAGESIZE=0x2000
-COMMONPAGESIZE=0x2000
-NONPAGED_TEXT_START_ADDR=0x10000
-ARCH=arc
-MACHINE=
-ENTRY=__start
-TEMPLATE_NAME=arclinux
-TEMPLATE_NAME=elf32
-EXTRA_EM_FILE=arclinux
-GENERATE_SHLIB_SCRIPT=yes
-SDATA_START_SYMBOLS='__SDATA_BEGIN__ = .;'
-OTHER_READONLY_SECTIONS="
- .__arc_profile_desc ${RELOCATING-0} : { *(.__arc_profile_desc) }
- .__arc_profile_forward ${RELOCATING-0} : { *(.__arc_profile_forward) }
-"
-OTHER_BSS_SECTIONS="
- .__arc_profile_counters ${RELOCATING-0} : { *(.__arc_profile_counters) }
-"
diff --git a/ld/emulparams/arcelf.sh b/ld/emulparams/arcelf.sh
index 14a3033..a0b9c8f 100644
--- a/ld/emulparams/arcelf.sh
+++ b/ld/emulparams/arcelf.sh
@@ -1,3 +1,4 @@
+. ${srcdir}/emulparams/arc-endianness.sh
SCRIPT_NAME=elfarc
TEMPLATE_NAME=elf32
if [ "x${ARC_ENDIAN}" = "xbig" ]; then
diff --git a/ld/emulparams/arcelf_prof.sh b/ld/emulparams/arcelf_prof.sh
index 0202002..c94e3cb 100644
--- a/ld/emulparams/arcelf_prof.sh
+++ b/ld/emulparams/arcelf_prof.sh
@@ -1,3 +1,4 @@
+. ${srcdir}/emulparams/arc-endianness.sh
SCRIPT_NAME=elfarc
TEMPLATE_NAME=elf32
if [ "x${ARC_ENDIAN}" = "xbig" ]; then
diff --git a/ld/emulparams/arclinux.sh b/ld/emulparams/arclinux.sh
index 452a272..9d17bfe 100644
--- a/ld/emulparams/arclinux.sh
+++ b/ld/emulparams/arclinux.sh
@@ -1,3 +1,4 @@
+. ${srcdir}/emulparams/arc-endianness.sh
SCRIPT_NAME=arclinux
if [ "x${ARC_ENDIAN}" = "xbig" ]; then
OUTPUT_FORMAT="elf32-bigarc"
diff --git a/ld/emulparams/arclinux_prof.sh b/ld/emulparams/arclinux_prof.sh
index fed098b..495f628 100644
--- a/ld/emulparams/arclinux_prof.sh
+++ b/ld/emulparams/arclinux_prof.sh
@@ -1,3 +1,4 @@
+. ${srcdir}/emulparams/arc-endianness.sh
SCRIPT_NAME=arclinux
if [ "x${ARC_ENDIAN}" = "xbig" ]; then
OUTPUT_FORMAT="elf32-bigarc"
diff --git a/ld/emulparams/arcv2elf.sh b/ld/emulparams/arcv2elf.sh
index 2793ea3..e21882b 100644
--- a/ld/emulparams/arcv2elf.sh
+++ b/ld/emulparams/arcv2elf.sh
@@ -1,3 +1,4 @@
+. ${srcdir}/emulparams/arc-endianness.sh
MACHINE=
SCRIPT_NAME=elfarcv2
if [ "x${ARC_ENDIAN}" = "xbig" ]; then
diff --git a/ld/emulparams/arcv2elfx.sh b/ld/emulparams/arcv2elfx.sh
index 9999d8d..7a4f284 100644
--- a/ld/emulparams/arcv2elfx.sh
+++ b/ld/emulparams/arcv2elfx.sh
@@ -1,3 +1,4 @@
+. ${srcdir}/emulparams/arc-endianness.sh
MACHINE=
SCRIPT_NAME=elfarcv2
if [ "x${ARC_ENDIAN}" = "xbig" ]; then