public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] ld/arc: Fix linker for big-endian arc targets
@ 2016-03-31 16:34 Andrew Burgess
  2016-04-03  8:38 ` Cupertino Miranda
  2016-04-05 14:01 ` Nick Clifton
  0 siblings, 2 replies; 9+ messages in thread
From: Andrew Burgess @ 2016-03-31 16:34 UTC (permalink / raw)
  To: binutils; +Cc: Claudiu.Zissulescu, Andrew Burgess

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-discard/extern.d: Update pattern for big and little
	endian arc targets.
	* testsuite/ld-discard/start.d: Likewise.
	* testsuite/ld-discard/static.d: Likewise.
	* testsuite/ld-elf/compressed1d.d: Likewise.
	* 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/orphan-region.d: Likewise.
	* testsuite/ld-elf/orphan.d: Likewise.
	* testsuite/ld-elf/orphan3.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/pr349.d: Likewise.
	* testsuite/ld-elf/sec64k.exp: Likewise.
	* testsuite/ld-elf/warn1.d: Likewise.
	* testsuite/ld-elf/warn2.d: Likewise.
	* testsuite/ld-elf/warn3.d: Likewise.
	* testsuite/lib/ld-lib.exp: Likewise.
---
 ld/ChangeLog                        | 42 +++++++++++++++++++++++++++++++++++++
 ld/emulparams/arc-endianness.sh     | 10 +++++++++
 ld/emulparams/arcebelf.sh           | 15 -------------
 ld/emulparams/arcebelf_prof.sh      | 21 -------------------
 ld/emulparams/arceblinux.sh         | 17 ---------------
 ld/emulparams/arceblinux_prof.sh    | 23 --------------------
 ld/emulparams/arcelf.sh             |  1 +
 ld/emulparams/arcelf_prof.sh        |  1 +
 ld/emulparams/arclinux.sh           |  1 +
 ld/emulparams/arclinux_prof.sh      |  1 +
 ld/emulparams/arcv2elf.sh           |  1 +
 ld/emulparams/arcv2elfx.sh          |  1 +
 ld/testsuite/ld-discard/extern.d    |  2 +-
 ld/testsuite/ld-discard/start.d     |  2 +-
 ld/testsuite/ld-discard/static.d    |  2 +-
 ld/testsuite/ld-elf/compressed1d.d  |  2 +-
 ld/testsuite/ld-elf/eh-frame-hdr.d  |  2 +-
 ld/testsuite/ld-elf/group1.d        |  2 +-
 ld/testsuite/ld-elf/group3b.d       |  2 +-
 ld/testsuite/ld-elf/group8a.d       |  2 +-
 ld/testsuite/ld-elf/group8b.d       |  2 +-
 ld/testsuite/ld-elf/group9a.d       |  2 +-
 ld/testsuite/ld-elf/group9b.d       |  2 +-
 ld/testsuite/ld-elf/linkonce2.d     |  2 +-
 ld/testsuite/ld-elf/orphan-region.d |  2 +-
 ld/testsuite/ld-elf/orphan.d        |  2 +-
 ld/testsuite/ld-elf/orphan3.d       |  2 +-
 ld/testsuite/ld-elf/pr12851.d       |  2 +-
 ld/testsuite/ld-elf/pr12975.d       |  2 +-
 ld/testsuite/ld-elf/pr13177.d       |  2 +-
 ld/testsuite/ld-elf/pr13195.d       |  2 +-
 ld/testsuite/ld-elf/pr17615.d       |  2 +-
 ld/testsuite/ld-elf/pr19162.d       |  2 +-
 ld/testsuite/ld-elf/pr349.d         |  2 +-
 ld/testsuite/ld-elf/sec64k.exp      |  2 +-
 ld/testsuite/ld-elf/warn1.d         |  2 +-
 ld/testsuite/ld-elf/warn2.d         |  2 +-
 ld/testsuite/ld-elf/warn3.d         |  2 +-
 ld/testsuite/lib/ld-lib.exp         |  4 ++--
 39 files changed, 86 insertions(+), 104 deletions(-)
 create mode 100644 ld/emulparams/arc-endianness.sh
 delete mode 100644 ld/emulparams/arcebelf.sh
 delete mode 100644 ld/emulparams/arcebelf_prof.sh
 delete mode 100644 ld/emulparams/arceblinux.sh
 delete mode 100644 ld/emulparams/arceblinux_prof.sh

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
diff --git a/ld/testsuite/ld-discard/extern.d b/ld/testsuite/ld-discard/extern.d
index 089beca..177f392 100644
--- a/ld/testsuite/ld-discard/extern.d
+++ b/ld/testsuite/ld-discard/extern.d
@@ -2,7 +2,7 @@
 #ld: -T discard.ld
 #error: .*data.* referenced in section `\.text' of tmpdir/dump0.o: defined in discarded section `\.data\.exit' of tmpdir/dump0.o
 #objdump: -p
-#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #xfail: m68hc12-*-* m6812-*-*
 #pass
 # The expected warning used to start with "`data' referenced..." but
diff --git a/ld/testsuite/ld-discard/start.d b/ld/testsuite/ld-discard/start.d
index 50c5574..40f8b14 100644
--- a/ld/testsuite/ld-discard/start.d
+++ b/ld/testsuite/ld-discard/start.d
@@ -3,6 +3,6 @@
 #ld: -T discard.ld
 #error: `data' referenced in section `\.text' of tmpdir/dump0.o: defined in discarded section `\.data\.exit' of tmpdir/dump1.o
 #objdump: -p
-#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #xfail: m68hc12-*-* m6812-*-*
 #pass
diff --git a/ld/testsuite/ld-discard/static.d b/ld/testsuite/ld-discard/static.d
index 7335ae5..558127a 100644
--- a/ld/testsuite/ld-discard/static.d
+++ b/ld/testsuite/ld-discard/static.d
@@ -2,6 +2,6 @@
 #ld: -T discard.ld
 #error: `(\.data\.exit|data)' referenced in section `\.text' of tmpdir/dump0.o: defined in discarded section `\.data\.exit' of tmpdir/dump0.o
 #objdump: -p
-#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #xfail: m68hc12-*-* m6812-*-*
 #pass
diff --git a/ld/testsuite/ld-elf/compressed1d.d b/ld/testsuite/ld-elf/compressed1d.d
index 5c07046..496557d 100644
--- a/ld/testsuite/ld-elf/compressed1d.d
+++ b/ld/testsuite/ld-elf/compressed1d.d
@@ -2,7 +2,7 @@
 #as: --compress-debug-sections=none
 #ld: -r --compress-debug-sections=zlib-gnu
 #readelf: -SW
-#notarget: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-* i370-*-* i860-*-* iq2000-*-* mn10200-*-* moxie-*-* msp430-*-* mt-*-* or1k-*-* pj-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-* i370-*-* i860-*-* iq2000-*-* mn10200-*-* moxie-*-* msp430-*-* mt-*-* or1k-*-* pj-*-*
 # Not all ELF targets use the elf.em emulation...
 
 #failif
diff --git a/ld/testsuite/ld-elf/eh-frame-hdr.d b/ld/testsuite/ld-elf/eh-frame-hdr.d
index 7e466c3..b4ea7fb 100644
--- a/ld/testsuite/ld-elf/eh-frame-hdr.d
+++ b/ld/testsuite/ld-elf/eh-frame-hdr.d
@@ -2,7 +2,7 @@
 #ld: -e _start --eh-frame-hdr
 #objdump: -hw
 #target: cfi
-#xfail: arc-*-elf* avr*-*-* or1k*-*-elf or1k*-*-rtems* visium-*-*
+#xfail: arc*-*-elf* avr*-*-* or1k*-*-elf or1k*-*-rtems* visium-*-*
 # These targets support CFI generation but not shared libraries.
 #...
   [0-9] .eh_frame_hdr 0*[12][048c] .*
diff --git a/ld/testsuite/ld-elf/group1.d b/ld/testsuite/ld-elf/group1.d
index 257be11..4535cc5 100644
--- a/ld/testsuite/ld-elf/group1.d
+++ b/ld/testsuite/ld-elf/group1.d
@@ -2,7 +2,7 @@
 #source: group1b.s
 #ld: -T group.ld
 #readelf: -s
-#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 # generic linker targets don't comply with all symbol merging rules
 
 Symbol table '.symtab' contains .* entries:
diff --git a/ld/testsuite/ld-elf/group3b.d b/ld/testsuite/ld-elf/group3b.d
index 5182f3d..0da9540 100644
--- a/ld/testsuite/ld-elf/group3b.d
+++ b/ld/testsuite/ld-elf/group3b.d
@@ -2,7 +2,7 @@
 #source: group3a.s
 #ld: -T group.ld
 #readelf: -s
-#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 # generic linker targets don't comply with all symbol merging rules
 
 Symbol table '.symtab' contains .* entries:
diff --git a/ld/testsuite/ld-elf/group8a.d b/ld/testsuite/ld-elf/group8a.d
index f645256..3613044 100644
--- a/ld/testsuite/ld-elf/group8a.d
+++ b/ld/testsuite/ld-elf/group8a.d
@@ -1,7 +1,7 @@
 #source: group8.s
 #ld: -r --gc-sections --entry foo
 #readelf: -g --wide
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 #xfail: cr16-*-* crx-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others
diff --git a/ld/testsuite/ld-elf/group8b.d b/ld/testsuite/ld-elf/group8b.d
index 2ce6b1a..3859cb6 100644
--- a/ld/testsuite/ld-elf/group8b.d
+++ b/ld/testsuite/ld-elf/group8b.d
@@ -1,7 +1,7 @@
 #source: group8.s
 #ld: -r --gc-sections --entry bar
 #readelf: -g --wide
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 #xfail: cr16-*-* crx-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others
diff --git a/ld/testsuite/ld-elf/group9a.d b/ld/testsuite/ld-elf/group9a.d
index 62215a5..4e8341d 100644
--- a/ld/testsuite/ld-elf/group9a.d
+++ b/ld/testsuite/ld-elf/group9a.d
@@ -1,7 +1,7 @@
 #source: group9.s
 #ld: -r --gc-sections --entry foo
 #readelf: -g --wide
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: alpha-*-* hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 #xfail: cr16-*-* crx-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others
diff --git a/ld/testsuite/ld-elf/group9b.d b/ld/testsuite/ld-elf/group9b.d
index c4600d8..ce5931c 100644
--- a/ld/testsuite/ld-elf/group9b.d
+++ b/ld/testsuite/ld-elf/group9b.d
@@ -1,7 +1,7 @@
 #source: group9.s
 #ld: -r --gc-sections --entry bar
 #readelf: -g --wide
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: alpha-*-* hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 #xfail: cr16-*-* crx-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others
diff --git a/ld/testsuite/ld-elf/linkonce2.d b/ld/testsuite/ld-elf/linkonce2.d
index edc135f..7668b32 100644
--- a/ld/testsuite/ld-elf/linkonce2.d
+++ b/ld/testsuite/ld-elf/linkonce2.d
@@ -2,7 +2,7 @@
 #source: linkonce1b.s
 #ld: -emit-relocs
 #objdump: -r
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 # generic elf targets don't emit relocs
 
 .*:     file format .*
diff --git a/ld/testsuite/ld-elf/orphan-region.d b/ld/testsuite/ld-elf/orphan-region.d
index 481d822..8fd2569 100644
--- a/ld/testsuite/ld-elf/orphan-region.d
+++ b/ld/testsuite/ld-elf/orphan-region.d
@@ -1,7 +1,7 @@
 #source: orphan-region.s
 #ld: -T orphan-region.ld -N -z stack-size=0
 #readelf: -S -l --wide
-#xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
 #xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* pj*-*-*
 #xfail: spu-*-* hppa*64*-*-* *-*-nacl*
 # if not using elf32.em, you don't get fancy orphan handling
diff --git a/ld/testsuite/ld-elf/orphan.d b/ld/testsuite/ld-elf/orphan.d
index 630e596..94b664f 100644
--- a/ld/testsuite/ld-elf/orphan.d
+++ b/ld/testsuite/ld-elf/orphan.d
@@ -1,7 +1,7 @@
 #source: orphan.s
 #ld: -T orphan.ld
 #readelf: -S --wide
-#xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
 #xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* pj*-*-*
 # if not using elf32.em, you don't get fancy orphan handling
 
diff --git a/ld/testsuite/ld-elf/orphan3.d b/ld/testsuite/ld-elf/orphan3.d
index dbaaa43..3f3c3e9 100644
--- a/ld/testsuite/ld-elf/orphan3.d
+++ b/ld/testsuite/ld-elf/orphan3.d
@@ -6,7 +6,7 @@
 #source: orphan3f.s
 #ld:
 #readelf: -S --wide
-#xfail: "arc-*-*" "d30v-*-*" "dlx-*-*" "fr30-*-*" "frv-*-elf"
+#xfail: "arc*-*-*" "d30v-*-*" "dlx-*-*" "fr30-*-*" "frv-*-elf"
 #xfail: "i860-*-*" "i960-*-*" "iq2000-*-*" "mn10200-*-*" "msp430-*-*" "mt-*-*"
 #xfail: "pj-*-*"
 #xfail: "xstormy16-*-*"
diff --git a/ld/testsuite/ld-elf/pr12851.d b/ld/testsuite/ld-elf/pr12851.d
index 8aa48e9..f02e3d2 100644
--- a/ld/testsuite/ld-elf/pr12851.d
+++ b/ld/testsuite/ld-elf/pr12851.d
@@ -2,7 +2,7 @@
 #source: start.s
 #ld: --gc-sections
 #readelf: -s --wide
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others
 
diff --git a/ld/testsuite/ld-elf/pr12975.d b/ld/testsuite/ld-elf/pr12975.d
index 11ace1f..97326a7 100644
--- a/ld/testsuite/ld-elf/pr12975.d
+++ b/ld/testsuite/ld-elf/pr12975.d
@@ -1,7 +1,7 @@
 #ld: --gc-sections -shared -version-script pr12975.t
 #readelf: -s --wide
 #target: *-*-linux* *-*-gnu*
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others
 
diff --git a/ld/testsuite/ld-elf/pr13177.d b/ld/testsuite/ld-elf/pr13177.d
index a009988..d47aadf 100644
--- a/ld/testsuite/ld-elf/pr13177.d
+++ b/ld/testsuite/ld-elf/pr13177.d
@@ -2,7 +2,7 @@
 #ld: --gc-sections -shared
 #readelf: -s -D --wide
 #target: *-*-linux* *-*-gnu*
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others
 
diff --git a/ld/testsuite/ld-elf/pr13195.d b/ld/testsuite/ld-elf/pr13195.d
index 6b39f2d..c806c11 100644
--- a/ld/testsuite/ld-elf/pr13195.d
+++ b/ld/testsuite/ld-elf/pr13195.d
@@ -1,7 +1,7 @@
 #ld: --gc-sections -shared -version-script pr13195.t
 #readelf: -s --wide -D
 #target: *-*-linux* *-*-gnu*
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others
 
diff --git a/ld/testsuite/ld-elf/pr17615.d b/ld/testsuite/ld-elf/pr17615.d
index 1b7a59b..0b11823 100644
--- a/ld/testsuite/ld-elf/pr17615.d
+++ b/ld/testsuite/ld-elf/pr17615.d
@@ -1,7 +1,7 @@
 #ld: --gc-sections -shared
 #readelf: -S --wide --dyn-syms
 #target: *-*-linux* *-*-gnu*
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others
 
diff --git a/ld/testsuite/ld-elf/pr19162.d b/ld/testsuite/ld-elf/pr19162.d
index c08bbed..1a54546 100644
--- a/ld/testsuite/ld-elf/pr19162.d
+++ b/ld/testsuite/ld-elf/pr19162.d
@@ -3,7 +3,7 @@
 #ld: -shared -z max-page-size=0x200000
 #readelf: -l --wide
 #target: *-*-linux* *-*-gnu* *-*-nacl*
-#notarget: arc-*-* hppa-*-*
+#notarget: arc*-*-* hppa-*-*
 # arc target has an extra 64K stack section.
 # hppa fails due to PR 12376.
 
diff --git a/ld/testsuite/ld-elf/pr349.d b/ld/testsuite/ld-elf/pr349.d
index f2a577f..f08fde0 100644
--- a/ld/testsuite/ld-elf/pr349.d
+++ b/ld/testsuite/ld-elf/pr349.d
@@ -2,7 +2,7 @@
 #source: pr349-2.s
 #ld: -r
 #readelf: -S
-#xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
 #xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* pj*-*-*
 # if not using elf32.em, you don't get fancy section handling
 
diff --git a/ld/testsuite/ld-elf/sec64k.exp b/ld/testsuite/ld-elf/sec64k.exp
index 7d079ce..f168cff 100644
--- a/ld/testsuite/ld-elf/sec64k.exp
+++ b/ld/testsuite/ld-elf/sec64k.exp
@@ -29,7 +29,7 @@ if ![is_elf_format] {
 
 # Targets using the generic linker backend don't sort section symbols
 # before local symbols, so don't bother testing them.
-if { [istarget "arc-*-*"]
+if { [istarget "arc*-*-*"]
      || [istarget "d30v-*-*"]
      || [istarget "dlx-*-*"]
      || [istarget "i960-*-*"]
diff --git a/ld/testsuite/ld-elf/warn1.d b/ld/testsuite/ld-elf/warn1.d
index b22b64f..153772c 100644
--- a/ld/testsuite/ld-elf/warn1.d
+++ b/ld/testsuite/ld-elf/warn1.d
@@ -5,7 +5,7 @@
 #warning: ^[^\\n]*\): warning: witty one-liner$
 #readelf: -s
 #notarget: "sparc64-*-solaris2*" "sparcv9-*-solaris2*"
-#xfail: "arc-*-*" "d30v-*-*" "dlx-*-*" "i960-*-*" "pj-*-*"
+#xfail: "arc*-*-*" "d30v-*-*" "dlx-*-*" "i960-*-*" "pj-*-*"
 
 # Check that warnings are generated for the .gnu.warning.SYMBOL
 # construct and that the symbol still appears as expected.
diff --git a/ld/testsuite/ld-elf/warn2.d b/ld/testsuite/ld-elf/warn2.d
index ee7220e..3c44c24 100644
--- a/ld/testsuite/ld-elf/warn2.d
+++ b/ld/testsuite/ld-elf/warn2.d
@@ -5,7 +5,7 @@
 #warning: ^[^\\n]*\.[obj]+: warning: function 'Foo' used$
 #readelf: -s
 #notarget: "sparc64-*-solaris2*" "sparcv9-*-solaris2*"
-#xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
 #xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* pj*-*-*
 # if not using elf32.em, you don't get fancy section handling
 
diff --git a/ld/testsuite/ld-elf/warn3.d b/ld/testsuite/ld-elf/warn3.d
index dc24540..c0c9cd6 100644
--- a/ld/testsuite/ld-elf/warn3.d
+++ b/ld/testsuite/ld-elf/warn3.d
@@ -3,7 +3,7 @@
 #warning: .*: warning: badsym warning$
 #readelf: -s
 #notarget: hppa64*-hpux*
-#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 # generic linker targets don't support .gnu.warning sections.
 
 # Check that warnings are generated for the symbols in .gnu.warning
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 320ed82..ce446fd 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1664,7 +1664,7 @@ proc check_gc_sections_available { } {
     if {![info exists gc_sections_available_saved]} {
 	# Some targets don't support gc-sections despite whatever's
 	# advertised by ld's options.
-	if {   [istarget arc-*-*]
+	if {   [istarget arc*-*-*]
 	    || [istarget d30v-*-*]
 	    || [istarget dlx-*-*]
 	    || [istarget i960-*-*]
@@ -1706,7 +1706,7 @@ proc check_gc_sections_available { } {
 
 proc check_shared_lib_support { } {
     if {![istarget aarch64*-*-elf]
-	 && ![istarget arc-*-*]
+	 && ![istarget arc*-*-*]
 	 && ![istarget arm*-*-elf]
 	 && ![istarget avr-*-*]
 	 && ![istarget cr16-*-*]
-- 
2.5.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] ld/arc: Fix linker for big-endian arc targets
  2016-03-31 16:34 [PATCH] ld/arc: Fix linker for big-endian arc targets Andrew Burgess
@ 2016-04-03  8:38 ` Cupertino Miranda
  2016-04-05 14:01 ` Nick Clifton
  1 sibling, 0 replies; 9+ messages in thread
From: Cupertino Miranda @ 2016-04-03  8:38 UTC (permalink / raw)
  To: Andrew Burgess, binutils; +Cc: Claudiu.Zissulescu

Hi Andrew,

The patch seems Ok.

Cheers,
Cupertino
________________________________________
From: binutils-owner@sourceware.org [binutils-owner@sourceware.org] on behalf of Andrew Burgess [andrew.burgess@embecosm.com]
Sent: Thursday, March 31, 2016 6:34 PM
To: binutils@sourceware.org
Cc: Claudiu.Zissulescu@synopsys.com; Andrew Burgess
Subject: [PATCH] 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-discard/extern.d: Update pattern for big and little
        endian arc targets.
        * testsuite/ld-discard/start.d: Likewise.
        * testsuite/ld-discard/static.d: Likewise.
        * testsuite/ld-elf/compressed1d.d: Likewise.
        * 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/orphan-region.d: Likewise.
        * testsuite/ld-elf/orphan.d: Likewise.
        * testsuite/ld-elf/orphan3.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/pr349.d: Likewise.
        * testsuite/ld-elf/sec64k.exp: Likewise.
        * testsuite/ld-elf/warn1.d: Likewise.
        * testsuite/ld-elf/warn2.d: Likewise.
        * testsuite/ld-elf/warn3.d: Likewise.
        * testsuite/lib/ld-lib.exp: Likewise.
---
 ld/ChangeLog                        | 42 +++++++++++++++++++++++++++++++++++++
 ld/emulparams/arc-endianness.sh     | 10 +++++++++
 ld/emulparams/arcebelf.sh           | 15 -------------
 ld/emulparams/arcebelf_prof.sh      | 21 -------------------
 ld/emulparams/arceblinux.sh         | 17 ---------------
 ld/emulparams/arceblinux_prof.sh    | 23 --------------------
 ld/emulparams/arcelf.sh             |  1 +
 ld/emulparams/arcelf_prof.sh        |  1 +
 ld/emulparams/arclinux.sh           |  1 +
 ld/emulparams/arclinux_prof.sh      |  1 +
 ld/emulparams/arcv2elf.sh           |  1 +
 ld/emulparams/arcv2elfx.sh          |  1 +
 ld/testsuite/ld-discard/extern.d    |  2 +-
 ld/testsuite/ld-discard/start.d     |  2 +-
 ld/testsuite/ld-discard/static.d    |  2 +-
 ld/testsuite/ld-elf/compressed1d.d  |  2 +-
 ld/testsuite/ld-elf/eh-frame-hdr.d  |  2 +-
 ld/testsuite/ld-elf/group1.d        |  2 +-
 ld/testsuite/ld-elf/group3b.d       |  2 +-
 ld/testsuite/ld-elf/group8a.d       |  2 +-
 ld/testsuite/ld-elf/group8b.d       |  2 +-
 ld/testsuite/ld-elf/group9a.d       |  2 +-
 ld/testsuite/ld-elf/group9b.d       |  2 +-
 ld/testsuite/ld-elf/linkonce2.d     |  2 +-
 ld/testsuite/ld-elf/orphan-region.d |  2 +-
 ld/testsuite/ld-elf/orphan.d        |  2 +-
 ld/testsuite/ld-elf/orphan3.d       |  2 +-
 ld/testsuite/ld-elf/pr12851.d       |  2 +-
 ld/testsuite/ld-elf/pr12975.d       |  2 +-
 ld/testsuite/ld-elf/pr13177.d       |  2 +-
 ld/testsuite/ld-elf/pr13195.d       |  2 +-
 ld/testsuite/ld-elf/pr17615.d       |  2 +-
 ld/testsuite/ld-elf/pr19162.d       |  2 +-
 ld/testsuite/ld-elf/pr349.d         |  2 +-
 ld/testsuite/ld-elf/sec64k.exp      |  2 +-
 ld/testsuite/ld-elf/warn1.d         |  2 +-
 ld/testsuite/ld-elf/warn2.d         |  2 +-
 ld/testsuite/ld-elf/warn3.d         |  2 +-
 ld/testsuite/lib/ld-lib.exp         |  4 ++--
 39 files changed, 86 insertions(+), 104 deletions(-)
 create mode 100644 ld/emulparams/arc-endianness.sh
 delete mode 100644 ld/emulparams/arcebelf.sh
 delete mode 100644 ld/emulparams/arcebelf_prof.sh
 delete mode 100644 ld/emulparams/arceblinux.sh
 delete mode 100644 ld/emulparams/arceblinux_prof.sh

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
diff --git a/ld/testsuite/ld-discard/extern.d b/ld/testsuite/ld-discard/extern.d
index 089beca..177f392 100644
--- a/ld/testsuite/ld-discard/extern.d
+++ b/ld/testsuite/ld-discard/extern.d
@@ -2,7 +2,7 @@
 #ld: -T discard.ld
 #error: .*data.* referenced in section `\.text' of tmpdir/dump0.o: defined in discarded section `\.data\.exit' of tmpdir/dump0.o
 #objdump: -p
-#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #xfail: m68hc12-*-* m6812-*-*
 #pass
 # The expected warning used to start with "`data' referenced..." but
diff --git a/ld/testsuite/ld-discard/start.d b/ld/testsuite/ld-discard/start.d
index 50c5574..40f8b14 100644
--- a/ld/testsuite/ld-discard/start.d
+++ b/ld/testsuite/ld-discard/start.d
@@ -3,6 +3,6 @@
 #ld: -T discard.ld
 #error: `data' referenced in section `\.text' of tmpdir/dump0.o: defined in discarded section `\.data\.exit' of tmpdir/dump1.o
 #objdump: -p
-#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #xfail: m68hc12-*-* m6812-*-*
 #pass
diff --git a/ld/testsuite/ld-discard/static.d b/ld/testsuite/ld-discard/static.d
index 7335ae5..558127a 100644
--- a/ld/testsuite/ld-discard/static.d
+++ b/ld/testsuite/ld-discard/static.d
@@ -2,6 +2,6 @@
 #ld: -T discard.ld
 #error: `(\.data\.exit|data)' referenced in section `\.text' of tmpdir/dump0.o: defined in discarded section `\.data\.exit' of tmpdir/dump0.o
 #objdump: -p
-#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #xfail: m68hc12-*-* m6812-*-*
 #pass
diff --git a/ld/testsuite/ld-elf/compressed1d.d b/ld/testsuite/ld-elf/compressed1d.d
index 5c07046..496557d 100644
--- a/ld/testsuite/ld-elf/compressed1d.d
+++ b/ld/testsuite/ld-elf/compressed1d.d
@@ -2,7 +2,7 @@
 #as: --compress-debug-sections=none
 #ld: -r --compress-debug-sections=zlib-gnu
 #readelf: -SW
-#notarget: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-* i370-*-* i860-*-* iq2000-*-* mn10200-*-* moxie-*-* msp430-*-* mt-*-* or1k-*-* pj-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-* i370-*-* i860-*-* iq2000-*-* mn10200-*-* moxie-*-* msp430-*-* mt-*-* or1k-*-* pj-*-*
 # Not all ELF targets use the elf.em emulation...

 #failif
diff --git a/ld/testsuite/ld-elf/eh-frame-hdr.d b/ld/testsuite/ld-elf/eh-frame-hdr.d
index 7e466c3..b4ea7fb 100644
--- a/ld/testsuite/ld-elf/eh-frame-hdr.d
+++ b/ld/testsuite/ld-elf/eh-frame-hdr.d
@@ -2,7 +2,7 @@
 #ld: -e _start --eh-frame-hdr
 #objdump: -hw
 #target: cfi
-#xfail: arc-*-elf* avr*-*-* or1k*-*-elf or1k*-*-rtems* visium-*-*
+#xfail: arc*-*-elf* avr*-*-* or1k*-*-elf or1k*-*-rtems* visium-*-*
 # These targets support CFI generation but not shared libraries.
 #...
   [0-9] .eh_frame_hdr 0*[12][048c] .*
diff --git a/ld/testsuite/ld-elf/group1.d b/ld/testsuite/ld-elf/group1.d
index 257be11..4535cc5 100644
--- a/ld/testsuite/ld-elf/group1.d
+++ b/ld/testsuite/ld-elf/group1.d
@@ -2,7 +2,7 @@
 #source: group1b.s
 #ld: -T group.ld
 #readelf: -s
-#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 # generic linker targets don't comply with all symbol merging rules

 Symbol table '.symtab' contains .* entries:
diff --git a/ld/testsuite/ld-elf/group3b.d b/ld/testsuite/ld-elf/group3b.d
index 5182f3d..0da9540 100644
--- a/ld/testsuite/ld-elf/group3b.d
+++ b/ld/testsuite/ld-elf/group3b.d
@@ -2,7 +2,7 @@
 #source: group3a.s
 #ld: -T group.ld
 #readelf: -s
-#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 # generic linker targets don't comply with all symbol merging rules

 Symbol table '.symtab' contains .* entries:
diff --git a/ld/testsuite/ld-elf/group8a.d b/ld/testsuite/ld-elf/group8a.d
index f645256..3613044 100644
--- a/ld/testsuite/ld-elf/group8a.d
+++ b/ld/testsuite/ld-elf/group8a.d
@@ -1,7 +1,7 @@
 #source: group8.s
 #ld: -r --gc-sections --entry foo
 #readelf: -g --wide
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 #xfail: cr16-*-* crx-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others
diff --git a/ld/testsuite/ld-elf/group8b.d b/ld/testsuite/ld-elf/group8b.d
index 2ce6b1a..3859cb6 100644
--- a/ld/testsuite/ld-elf/group8b.d
+++ b/ld/testsuite/ld-elf/group8b.d
@@ -1,7 +1,7 @@
 #source: group8.s
 #ld: -r --gc-sections --entry bar
 #readelf: -g --wide
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 #xfail: cr16-*-* crx-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others
diff --git a/ld/testsuite/ld-elf/group9a.d b/ld/testsuite/ld-elf/group9a.d
index 62215a5..4e8341d 100644
--- a/ld/testsuite/ld-elf/group9a.d
+++ b/ld/testsuite/ld-elf/group9a.d
@@ -1,7 +1,7 @@
 #source: group9.s
 #ld: -r --gc-sections --entry foo
 #readelf: -g --wide
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: alpha-*-* hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 #xfail: cr16-*-* crx-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others
diff --git a/ld/testsuite/ld-elf/group9b.d b/ld/testsuite/ld-elf/group9b.d
index c4600d8..ce5931c 100644
--- a/ld/testsuite/ld-elf/group9b.d
+++ b/ld/testsuite/ld-elf/group9b.d
@@ -1,7 +1,7 @@
 #source: group9.s
 #ld: -r --gc-sections --entry bar
 #readelf: -g --wide
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: alpha-*-* hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 #xfail: cr16-*-* crx-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others
diff --git a/ld/testsuite/ld-elf/linkonce2.d b/ld/testsuite/ld-elf/linkonce2.d
index edc135f..7668b32 100644
--- a/ld/testsuite/ld-elf/linkonce2.d
+++ b/ld/testsuite/ld-elf/linkonce2.d
@@ -2,7 +2,7 @@
 #source: linkonce1b.s
 #ld: -emit-relocs
 #objdump: -r
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 # generic elf targets don't emit relocs

 .*:     file format .*
diff --git a/ld/testsuite/ld-elf/orphan-region.d b/ld/testsuite/ld-elf/orphan-region.d
index 481d822..8fd2569 100644
--- a/ld/testsuite/ld-elf/orphan-region.d
+++ b/ld/testsuite/ld-elf/orphan-region.d
@@ -1,7 +1,7 @@
 #source: orphan-region.s
 #ld: -T orphan-region.ld -N -z stack-size=0
 #readelf: -S -l --wide
-#xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
 #xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* pj*-*-*
 #xfail: spu-*-* hppa*64*-*-* *-*-nacl*
 # if not using elf32.em, you don't get fancy orphan handling
diff --git a/ld/testsuite/ld-elf/orphan.d b/ld/testsuite/ld-elf/orphan.d
index 630e596..94b664f 100644
--- a/ld/testsuite/ld-elf/orphan.d
+++ b/ld/testsuite/ld-elf/orphan.d
@@ -1,7 +1,7 @@
 #source: orphan.s
 #ld: -T orphan.ld
 #readelf: -S --wide
-#xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
 #xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* pj*-*-*
 # if not using elf32.em, you don't get fancy orphan handling

diff --git a/ld/testsuite/ld-elf/orphan3.d b/ld/testsuite/ld-elf/orphan3.d
index dbaaa43..3f3c3e9 100644
--- a/ld/testsuite/ld-elf/orphan3.d
+++ b/ld/testsuite/ld-elf/orphan3.d
@@ -6,7 +6,7 @@
 #source: orphan3f.s
 #ld:
 #readelf: -S --wide
-#xfail: "arc-*-*" "d30v-*-*" "dlx-*-*" "fr30-*-*" "frv-*-elf"
+#xfail: "arc*-*-*" "d30v-*-*" "dlx-*-*" "fr30-*-*" "frv-*-elf"
 #xfail: "i860-*-*" "i960-*-*" "iq2000-*-*" "mn10200-*-*" "msp430-*-*" "mt-*-*"
 #xfail: "pj-*-*"
 #xfail: "xstormy16-*-*"
diff --git a/ld/testsuite/ld-elf/pr12851.d b/ld/testsuite/ld-elf/pr12851.d
index 8aa48e9..f02e3d2 100644
--- a/ld/testsuite/ld-elf/pr12851.d
+++ b/ld/testsuite/ld-elf/pr12851.d
@@ -2,7 +2,7 @@
 #source: start.s
 #ld: --gc-sections
 #readelf: -s --wide
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others

diff --git a/ld/testsuite/ld-elf/pr12975.d b/ld/testsuite/ld-elf/pr12975.d
index 11ace1f..97326a7 100644
--- a/ld/testsuite/ld-elf/pr12975.d
+++ b/ld/testsuite/ld-elf/pr12975.d
@@ -1,7 +1,7 @@
 #ld: --gc-sections -shared -version-script pr12975.t
 #readelf: -s --wide
 #target: *-*-linux* *-*-gnu*
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others

diff --git a/ld/testsuite/ld-elf/pr13177.d b/ld/testsuite/ld-elf/pr13177.d
index a009988..d47aadf 100644
--- a/ld/testsuite/ld-elf/pr13177.d
+++ b/ld/testsuite/ld-elf/pr13177.d
@@ -2,7 +2,7 @@
 #ld: --gc-sections -shared
 #readelf: -s -D --wide
 #target: *-*-linux* *-*-gnu*
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others

diff --git a/ld/testsuite/ld-elf/pr13195.d b/ld/testsuite/ld-elf/pr13195.d
index 6b39f2d..c806c11 100644
--- a/ld/testsuite/ld-elf/pr13195.d
+++ b/ld/testsuite/ld-elf/pr13195.d
@@ -1,7 +1,7 @@
 #ld: --gc-sections -shared -version-script pr13195.t
 #readelf: -s --wide -D
 #target: *-*-linux* *-*-gnu*
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others

diff --git a/ld/testsuite/ld-elf/pr17615.d b/ld/testsuite/ld-elf/pr17615.d
index 1b7a59b..0b11823 100644
--- a/ld/testsuite/ld-elf/pr17615.d
+++ b/ld/testsuite/ld-elf/pr17615.d
@@ -1,7 +1,7 @@
 #ld: --gc-sections -shared
 #readelf: -S --wide --dyn-syms
 #target: *-*-linux* *-*-gnu*
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#notarget: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others

diff --git a/ld/testsuite/ld-elf/pr19162.d b/ld/testsuite/ld-elf/pr19162.d
index c08bbed..1a54546 100644
--- a/ld/testsuite/ld-elf/pr19162.d
+++ b/ld/testsuite/ld-elf/pr19162.d
@@ -3,7 +3,7 @@
 #ld: -shared -z max-page-size=0x200000
 #readelf: -l --wide
 #target: *-*-linux* *-*-gnu* *-*-nacl*
-#notarget: arc-*-* hppa-*-*
+#notarget: arc*-*-* hppa-*-*
 # arc target has an extra 64K stack section.
 # hppa fails due to PR 12376.

diff --git a/ld/testsuite/ld-elf/pr349.d b/ld/testsuite/ld-elf/pr349.d
index f2a577f..f08fde0 100644
--- a/ld/testsuite/ld-elf/pr349.d
+++ b/ld/testsuite/ld-elf/pr349.d
@@ -2,7 +2,7 @@
 #source: pr349-2.s
 #ld: -r
 #readelf: -S
-#xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
 #xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* pj*-*-*
 # if not using elf32.em, you don't get fancy section handling

diff --git a/ld/testsuite/ld-elf/sec64k.exp b/ld/testsuite/ld-elf/sec64k.exp
index 7d079ce..f168cff 100644
--- a/ld/testsuite/ld-elf/sec64k.exp
+++ b/ld/testsuite/ld-elf/sec64k.exp
@@ -29,7 +29,7 @@ if ![is_elf_format] {

 # Targets using the generic linker backend don't sort section symbols
 # before local symbols, so don't bother testing them.
-if { [istarget "arc-*-*"]
+if { [istarget "arc*-*-*"]
      || [istarget "d30v-*-*"]
      || [istarget "dlx-*-*"]
      || [istarget "i960-*-*"]
diff --git a/ld/testsuite/ld-elf/warn1.d b/ld/testsuite/ld-elf/warn1.d
index b22b64f..153772c 100644
--- a/ld/testsuite/ld-elf/warn1.d
+++ b/ld/testsuite/ld-elf/warn1.d
@@ -5,7 +5,7 @@
 #warning: ^[^\\n]*\): warning: witty one-liner$
 #readelf: -s
 #notarget: "sparc64-*-solaris2*" "sparcv9-*-solaris2*"
-#xfail: "arc-*-*" "d30v-*-*" "dlx-*-*" "i960-*-*" "pj-*-*"
+#xfail: "arc*-*-*" "d30v-*-*" "dlx-*-*" "i960-*-*" "pj-*-*"

 # Check that warnings are generated for the .gnu.warning.SYMBOL
 # construct and that the symbol still appears as expected.
diff --git a/ld/testsuite/ld-elf/warn2.d b/ld/testsuite/ld-elf/warn2.d
index ee7220e..3c44c24 100644
--- a/ld/testsuite/ld-elf/warn2.d
+++ b/ld/testsuite/ld-elf/warn2.d
@@ -5,7 +5,7 @@
 #warning: ^[^\\n]*\.[obj]+: warning: function 'Foo' used$
 #readelf: -s
 #notarget: "sparc64-*-solaris2*" "sparcv9-*-solaris2*"
-#xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
 #xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* pj*-*-*
 # if not using elf32.em, you don't get fancy section handling

diff --git a/ld/testsuite/ld-elf/warn3.d b/ld/testsuite/ld-elf/warn3.d
index dc24540..c0c9cd6 100644
--- a/ld/testsuite/ld-elf/warn3.d
+++ b/ld/testsuite/ld-elf/warn3.d
@@ -3,7 +3,7 @@
 #warning: .*: warning: badsym warning$
 #readelf: -s
 #notarget: hppa64*-hpux*
-#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
+#xfail: arc*-*-* d30v-*-* dlx-*-* i960-*-* pj*-*-*
 # generic linker targets don't support .gnu.warning sections.

 # Check that warnings are generated for the symbols in .gnu.warning
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 320ed82..ce446fd 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1664,7 +1664,7 @@ proc check_gc_sections_available { } {
     if {![info exists gc_sections_available_saved]} {
        # Some targets don't support gc-sections despite whatever's
        # advertised by ld's options.
-       if {   [istarget arc-*-*]
+       if {   [istarget arc*-*-*]
            || [istarget d30v-*-*]
            || [istarget dlx-*-*]
            || [istarget i960-*-*]
@@ -1706,7 +1706,7 @@ proc check_gc_sections_available { } {

 proc check_shared_lib_support { } {
     if {![istarget aarch64*-*-elf]
-        && ![istarget arc-*-*]
+        && ![istarget arc*-*-*]
         && ![istarget arm*-*-elf]
         && ![istarget avr-*-*]
         && ![istarget cr16-*-*]
--
2.5.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ld/arc: Fix linker for big-endian arc targets
  2016-03-31 16:34 [PATCH] ld/arc: Fix linker for big-endian arc targets Andrew Burgess
  2016-04-03  8:38 ` Cupertino Miranda
@ 2016-04-05 14:01 ` Nick Clifton
  2016-04-07 14:07   ` Alan Modra
  1 sibling, 1 reply; 9+ messages in thread
From: Nick Clifton @ 2016-04-05 14:01 UTC (permalink / raw)
  To: Andrew Burgess, binutils; +Cc: Claudiu.Zissulescu

Hi Andrew,

> 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-discard/extern.d: Update pattern for big and little
> 	endian arc targets.
> 	* testsuite/ld-discard/start.d: Likewise.
> 	* testsuite/ld-discard/static.d: Likewise.
> 	* testsuite/ld-elf/compressed1d.d: Likewise.
> 	* 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/orphan-region.d: Likewise.
> 	* testsuite/ld-elf/orphan.d: Likewise.
> 	* testsuite/ld-elf/orphan3.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/pr349.d: Likewise.
> 	* testsuite/ld-elf/sec64k.exp: Likewise.
> 	* testsuite/ld-elf/warn1.d: Likewise.
> 	* testsuite/ld-elf/warn2.d: Likewise.
> 	* testsuite/ld-elf/warn3.d: Likewise.
> 	* testsuite/lib/ld-lib.exp: Likewise.

Approved - please apply.

Cheers
  Nick

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ld/arc: Fix linker for big-endian arc targets
  2016-04-05 14:01 ` Nick Clifton
@ 2016-04-07 14:07   ` Alan Modra
  2016-04-07 15:20     ` Claudiu Zissulescu
  2016-04-07 15:22     ` Andrew Burgess
  0 siblings, 2 replies; 9+ messages in thread
From: Alan Modra @ 2016-04-07 14:07 UTC (permalink / raw)
  To: Andrew Burgess, Claudiu.Zissulescu; +Cc: binutils

On Tue, Apr 05, 2016 at 03:00:48PM +0100, Nick Clifton wrote:
> > 	* 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.

It's likely that the above is responsible for breaking
--enable-targets=all builds.  Please fix.

base=`echo earcv2elf.c | sed -e 's,e\(.*\).c,\1,'`; \
make run-genscripts "script_target=$base" "script_tdirname=tdir_$base"
make[5]: Entering directory '/home/alan/build/gas/all/ld'
LIB_PATH='' /bin/bash /src/binutils-gdb/ld/genscripts.sh "/src/binutils-gdb/ld" "/usr/local/lib" "/usr/local" "/usr/local" x86_64-pc-linux-gnu x86_64-pc-linux-gnu x86_64-linux "elf_x86_64 elf_i386 elf32_x86_64 elf_l1om elf_k1om" "/usr/local/lib /lib /usr/lib" yes yes arcv2elf ""
Makefile:2200: recipe for target 'run-genscripts' failed
make[5]: *** [run-genscripts] Error 1
make[5]: Leaving directory '/home/alan/build/gas/all/ld'
Makefile:2205: recipe for target 'earcv2elf.c' failed
make[4]: *** [earcv2elf.c] Error 2

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] ld/arc: Fix linker for big-endian arc targets
  2016-04-07 14:07   ` Alan Modra
@ 2016-04-07 15:20     ` Claudiu Zissulescu
  2016-04-07 15:22     ` Andrew Burgess
  1 sibling, 0 replies; 9+ messages in thread
From: Claudiu Zissulescu @ 2016-04-07 15:20 UTC (permalink / raw)
  To: Alan Modra, Andrew Burgess; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 1970 bytes --]

Indeed the Andrew's patch breaks the build.  Attached my solution for the problem. 

Ok to commit?
Claudiu

> -----Original Message-----
> From: Alan Modra [mailto:amodra@gmail.com]
> Sent: Thursday, April 07, 2016 4:07 PM
> To: Andrew Burgess; Claudiu.Zissulescu@synopsys.com
> Cc: binutils@sourceware.org
> Subject: Re: [PATCH] ld/arc: Fix linker for big-endian arc targets
> 
> On Tue, Apr 05, 2016 at 03:00:48PM +0100, Nick Clifton wrote:
> > > 	* 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.
> 
> It's likely that the above is responsible for breaking
> --enable-targets=all builds.  Please fix.
> 
> base=`echo earcv2elf.c | sed -e 's,e\(.*\).c,\1,'`; \
> make run-genscripts "script_target=$base" "script_tdirname=tdir_$base"
> make[5]: Entering directory '/home/alan/build/gas/all/ld'
> LIB_PATH='' /bin/bash /src/binutils-gdb/ld/genscripts.sh "/src/binutils-
> gdb/ld" "/usr/local/lib" "/usr/local" "/usr/local" x86_64-pc-linux-gnu x86_64-
> pc-linux-gnu x86_64-linux "elf_x86_64 elf_i386 elf32_x86_64 elf_l1om
> elf_k1om" "/usr/local/lib /lib /usr/lib" yes yes arcv2elf ""
> Makefile:2200: recipe for target 'run-genscripts' failed
> make[5]: *** [run-genscripts] Error 1
> make[5]: Leaving directory '/home/alan/build/gas/all/ld'
> Makefile:2205: recipe for target 'earcv2elf.c' failed
> make[4]: *** [earcv2elf.c] Error 2
> 
> --
> Alan Modra
> Australia Development Lab, IBM

[-- Attachment #2: fix.patch --]
[-- Type: application/octet-stream, Size: 362 bytes --]

diff --git a/ld/emulparams/arc-endianness.sh b/ld/emulparams/arc-endianness.sh
index 4d6158b..b970460 100644
--- a/ld/emulparams/arc-endianness.sh
+++ b/ld/emulparams/arc-endianness.sh
@@ -2,9 +2,7 @@ case ${target} in
     arceb-*)
         ARC_ENDIAN="big"
         ;;
-    arc-*)
+    *)
         ARC_ENDIAN="little"
         ;;
-    *)
-        exit 1
 esac

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ld/arc: Fix linker for big-endian arc targets
  2016-04-07 14:07   ` Alan Modra
  2016-04-07 15:20     ` Claudiu Zissulescu
@ 2016-04-07 15:22     ` Andrew Burgess
  2016-04-07 15:33       ` Claudiu Zissulescu
  2016-04-07 15:42       ` Nick Clifton
  1 sibling, 2 replies; 9+ messages in thread
From: Andrew Burgess @ 2016-04-07 15:22 UTC (permalink / raw)
  To: Alan Modra; +Cc: Claudiu.Zissulescu, binutils

* Alan Modra <amodra@gmail.com> [2016-04-07 23:36:59 +0930]:

> On Tue, Apr 05, 2016 at 03:00:48PM +0100, Nick Clifton wrote:
> > > 	* 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.
> 
> It's likely that the above is responsible for breaking
> --enable-targets=all builds.  Please fix.

Sorry about that, the patch below should fix things.  OK to apply?

Thanks,
Andrew

---

ld/arc: Make little endian default choice for linker scripts

When building with --enable-targets=all the target string is not set to
something that matches the pattern arc*-*, and so the script used to
decide if we should build big or little endian linker script currently
exits with an error.

This commit makes little endian linker script be the default, which will
be used when building for all targets, this matches the behaviour from
before I made the endianness switchable, when we only ever built little
endian linker scripts anyway.

ld/ChangeLog:

	* emulparams/arc-endianness.sh: Make little endian default choice.

diff --git a/ld/emulparams/arc-endianness.sh b/ld/emulparams/arc-endianness.sh
index 4d6158b..7a66dee 100644
--- a/ld/emulparams/arc-endianness.sh
+++ b/ld/emulparams/arc-endianness.sh
@@ -1,10 +1,11 @@
+# Select an appropriate endinaness based on the value of target.  When
+# building for all targets we select little endian, which is what the
+# '*' pattern is for.
 case ${target} in
     arceb-*)
         ARC_ENDIAN="big"
         ;;
-    arc-*)
+    arc-* | * )
         ARC_ENDIAN="little"
         ;;
-    *)
-        exit 1
 esac

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] ld/arc: Fix linker for big-endian arc targets
  2016-04-07 15:22     ` Andrew Burgess
@ 2016-04-07 15:33       ` Claudiu Zissulescu
  2016-04-07 15:50         ` [PUSHED] " Andrew Burgess
  2016-04-07 15:42       ` Nick Clifton
  1 sibling, 1 reply; 9+ messages in thread
From: Claudiu Zissulescu @ 2016-04-07 15:33 UTC (permalink / raw)
  To: Andrew Burgess, Alan Modra; +Cc: binutils

Andrew,

Probably it is ok to commit it as it may break builds for other people, and the solution is very simple.

Best,
Claudiu

> -----Original Message-----
> From: Andrew Burgess [mailto:andrew.burgess@embecosm.com]
> Sent: Thursday, April 07, 2016 5:22 PM
> To: Alan Modra
> Cc: Claudiu.Zissulescu@synopsys.com; binutils@sourceware.org
> Subject: Re: [PATCH] ld/arc: Fix linker for big-endian arc targets
> 
> * Alan Modra <amodra@gmail.com> [2016-04-07 23:36:59 +0930]:
> 
> > On Tue, Apr 05, 2016 at 03:00:48PM +0100, Nick Clifton wrote:
> > > > 	* 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.
> >
> > It's likely that the above is responsible for breaking
> > --enable-targets=all builds.  Please fix.
> 
> Sorry about that, the patch below should fix things.  OK to apply?
> 
> Thanks,
> Andrew
> 
> ---
> 
> ld/arc: Make little endian default choice for linker scripts
> 
> When building with --enable-targets=all the target string is not set to
> something that matches the pattern arc*-*, and so the script used to
> decide if we should build big or little endian linker script currently
> exits with an error.
> 
> This commit makes little endian linker script be the default, which will
> be used when building for all targets, this matches the behaviour from
> before I made the endianness switchable, when we only ever built little
> endian linker scripts anyway.
> 
> ld/ChangeLog:
> 
> 	* emulparams/arc-endianness.sh: Make little endian default choice.
> 
> diff --git a/ld/emulparams/arc-endianness.sh b/ld/emulparams/arc-
> endianness.sh
> index 4d6158b..7a66dee 100644
> --- a/ld/emulparams/arc-endianness.sh
> +++ b/ld/emulparams/arc-endianness.sh
> @@ -1,10 +1,11 @@
> +# Select an appropriate endinaness based on the value of target.  When
> +# building for all targets we select little endian, which is what the
> +# '*' pattern is for.
>  case ${target} in
>      arceb-*)
>          ARC_ENDIAN="big"
>          ;;
> -    arc-*)
> +    arc-* | * )
>          ARC_ENDIAN="little"
>          ;;
> -    *)
> -        exit 1
>  esac

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ld/arc: Fix linker for big-endian arc targets
  2016-04-07 15:22     ` Andrew Burgess
  2016-04-07 15:33       ` Claudiu Zissulescu
@ 2016-04-07 15:42       ` Nick Clifton
  1 sibling, 0 replies; 9+ messages in thread
From: Nick Clifton @ 2016-04-07 15:42 UTC (permalink / raw)
  To: Andrew Burgess, Alan Modra; +Cc: Claudiu.Zissulescu, binutils

Hi Andrew,

> Sorry about that, the patch below should fix things.  OK to apply?

 
Approved - please apply.

Cheers
  Nick

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PUSHED] Re: [PATCH] ld/arc: Fix linker for big-endian arc targets
  2016-04-07 15:33       ` Claudiu Zissulescu
@ 2016-04-07 15:50         ` Andrew Burgess
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Burgess @ 2016-04-07 15:50 UTC (permalink / raw)
  To: Claudiu Zissulescu; +Cc: Alan Modra, binutils

* Claudiu Zissulescu <Claudiu.Zissulescu@synopsys.com> [2016-04-07 15:32:46 +0000]:

> Probably it is ok to commit it as it may break builds for other
> people, and the solution is very simple.

Pushed as an "obvious" fix.  If there's disagreement later it can be
backed out.

Thanks,
Andrew

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-04-07 15:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-31 16:34 [PATCH] ld/arc: Fix linker for big-endian arc targets Andrew Burgess
2016-04-03  8:38 ` Cupertino Miranda
2016-04-05 14:01 ` Nick Clifton
2016-04-07 14:07   ` Alan Modra
2016-04-07 15:20     ` Claudiu Zissulescu
2016-04-07 15:22     ` Andrew Burgess
2016-04-07 15:33       ` Claudiu Zissulescu
2016-04-07 15:50         ` [PUSHED] " Andrew Burgess
2016-04-07 15:42       ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).