aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorWalter Lee <walt@tilera.com>2012-02-25 19:51:34 +0000
committerWalter Lee <walt@tilera.com>2012-02-25 19:51:34 +0000
commitfb6ceddedd56805fc4fd64792a0e73baa8c22a21 (patch)
tree035d5e8c3f9a3be2c2b82f975fcde4e4074ba612 /ld
parent825902491e89db303b036d82eef32ef0b07d4317 (diff)
downloadgdb-fb6ceddedd56805fc4fd64792a0e73baa8c22a21.zip
gdb-fb6ceddedd56805fc4fd64792a0e73baa8c22a21.tar.gz
gdb-fb6ceddedd56805fc4fd64792a0e73baa8c22a21.tar.bz2
Add big-endian support for tilegx.
bfd/ * config.bfd (tilegx-*-*): rename little endian vector; add big endian vector. (tilegxbe-*-*): New case. * configure.in (bfd_elf32_tilegx_vec): Rename... (bfd_elf32_tilegx_le_vec): ... to this. (bfd_elf32_tilegx_be_vec): New vector. (bfd_elf64_tilegx_vec): Rename... (bfd_elf64_tilegx_le_vec): ... to this. (bfd_elf64_tilegx_be_vec): New vector. * configure: Regenerate. * elf32-tilegx.c (TARGET_LITTLE_SYM): Rename. (TARGET_LITTLE_NAME): Ditto. (TARGET_BIG_SYM): Define. (TARGET_BIG_NAME): Define. * elf64-tilegx.c (TARGET_LITTLE_SYM): Rename. (TARGET_LITTLE_NAME): Ditto. (TARGET_BIG_SYM): Define. (TARGET_BIG_NAME): Define. * targets.c (bfd_elf32_tilegx_vec): Rename... (bfd_elf32_tilegx_le_vec): ... to this. (bfd_elf32_tilegx_be_vec): Declare. (bfd_elf64_tilegx_vec): Rename... (bfd_elf64_tilegx_le_vec): ... to this. (bfd_elf64_tilegx_be_vec): Declare. (_bfd_target_vector): Add / rename above vectors. binutils/testsuite/ * binutils-all/objdump.exp (cpus_expected): Add tilegx. gas/ * tc-tilegx.c (tilegx_target_format): Handle big endian. (OPTION_EB): Define. (OPTION_EL): Define. (md_longopts): Add entries for "EB" and "EL". (md_parse_option): Handle OPTION_EB and OPTION_EL. (md_show_usage): Add -EB and -EL. (md_number_to_chars): New. * tc-tilegx.h (TARGET_BYTES_BIG_ENDIAN): Guard definition with ifndef. (md_number_to_chars): Delete. * configure.tgt (tilegx*be): Handle. * doc/as.texinfo [TILE-Gx]: Document -EB and -EL. * doc/c-tilegx.texi: Ditto. ld/ * Makefile.am (ALL_EMULATION_SOURCES): Add eelf32tilegx_be.c. (ALL_64_EMULATION_SOURCES): Add eelf64tilegx_be.c. (eelf32tilegx_be.c): Add rule to build this file. (eelf64tilegx_be.c): Ditto. * Makefile.in: Regenerate. * configure.tgt (tilegx-*-*): Support big endian. (tilegxbe-*-*): New. * emulparams/elf32tilegx.sh (OUTPUT_FORMAT): Rename. (BIG_OUTPUT_FORMAT): Define. (LITTLE_OUTPUT_FORMAT): Define. * emulparams/elf32tilegx_be.sh: New. * emulparams/elf64tilegx.sh (OUTPUT_FORMAT): Rename. (BIG_OUTPUT_FORMAT): Define. (LITTLE_OUTPUT_FORMAT): Define. * emulparams/elf64tilegx_be.sh: New. ld/testsuite/ * ld-tilegx/reloc-be.d: New. * ld-tilegx/reloc-le.d: New. * ld-tilegx/reloc.d: Delete. * ld-tilegx/tilegx.exp: Test big and little endian.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog18
-rw-r--r--ld/Makefile.am10
-rw-r--r--ld/Makefile.in12
-rw-r--r--ld/configure.tgt5
-rw-r--r--ld/emulparams/elf32tilegx.sh4
-rw-r--r--ld/emulparams/elf32tilegx_be.sh2
-rw-r--r--ld/emulparams/elf64tilegx.sh4
-rw-r--r--ld/emulparams/elf64tilegx_be.sh2
-rw-r--r--ld/testsuite/ChangeLog7
-rw-r--r--ld/testsuite/ld-tilegx/reloc-be.d70
-rw-r--r--ld/testsuite/ld-tilegx/reloc-le.d (renamed from ld/testsuite/ld-tilegx/reloc.d)2
-rw-r--r--ld/testsuite/ld-tilegx/tilegx.exp19
12 files changed, 145 insertions, 10 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 4f9a9b7..026ee08 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,21 @@
+2012-02-25 Walter Lee <walt@tilera.com>
+
+ * Makefile.am (ALL_EMULATION_SOURCES): Add eelf32tilegx_be.c.
+ (ALL_64_EMULATION_SOURCES): Add eelf64tilegx_be.c.
+ (eelf32tilegx_be.c): Add rule to build this file.
+ (eelf64tilegx_be.c): Ditto.
+ * Makefile.in: Regenerate.
+ * configure.tgt (tilegx-*-*): Support big endian.
+ (tilegxbe-*-*): New.
+ * emulparams/elf32tilegx.sh (OUTPUT_FORMAT): Rename.
+ (BIG_OUTPUT_FORMAT): Define.
+ (LITTLE_OUTPUT_FORMAT): Define.
+ * emulparams/elf32tilegx_be.sh: New.
+ * emulparams/elf64tilegx.sh (OUTPUT_FORMAT): Rename.
+ (BIG_OUTPUT_FORMAT): Define.
+ (LITTLE_OUTPUT_FORMAT): Define.
+ * emulparams/elf64tilegx_be.sh: New.
+
2012-02-24 Kai Tietz <ktietz@redhat.com>
PR binutils/13710
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 6bfb15c..37f8d1f 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -250,6 +250,7 @@ ALL_EMULATION_SOURCES = \
eelf32rl78.c \
eelf32rx.c \
eelf32tilegx.c \
+ eelf32tilegx_be.c \
eelf32tilepro.c \
eelf32vax.c \
eelf32xc16x.c \
@@ -482,6 +483,7 @@ ALL_64_EMULATION_SOURCES = \
eelf64ppc.c \
eelf64ppc_fbsd.c \
eelf64tilegx.c \
+ eelf64tilegx_be.c \
eelf_l1om.c \
eelf_l1om_fbsd.c \
eelf_k1om.c \
@@ -1152,6 +1154,10 @@ eelf32tilegx.c: $(srcdir)/emulparams/elf32tilegx.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32tilegx "$(tdir_tilegx)"
+eelf32tilegx_be.c: $(srcdir)/emulparams/elf32tilegx_be.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32tilegx_be "$(tdir_tilegx_be)"
eelf32tilepro.c: $(srcdir)/emulparams/elf32tilepro.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -1989,6 +1995,10 @@ eelf64tilegx.c: $(srcdir)/emulparams/elf64tilegx.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64tilegx "$(tdir_tilegx)"
+eelf64tilegx_be.c: $(srcdir)/emulparams/elf64tilegx_be.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf64tilegx_be "$(tdir_tilegx_be)"
eelf_l1om.c: $(srcdir)/emulparams/elf_l1om.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_l1om "$(tdir_elf_l1om)"
diff --git a/ld/Makefile.in b/ld/Makefile.in
index a7bbe41..1616f58 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -556,6 +556,7 @@ ALL_EMULATION_SOURCES = \
eelf32rl78.c \
eelf32rx.c \
eelf32tilegx.c \
+ eelf32tilegx_be.c \
eelf32tilepro.c \
eelf32vax.c \
eelf32xc16x.c \
@@ -787,6 +788,7 @@ ALL_64_EMULATION_SOURCES = \
eelf64ppc.c \
eelf64ppc_fbsd.c \
eelf64tilegx.c \
+ eelf64tilegx_be.c \
eelf_l1om.c \
eelf_l1om_fbsd.c \
eelf_k1om.c \
@@ -1159,6 +1161,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32rl78.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32rx.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32tilegx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32tilegx_be.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32tilepro.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32vax.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xc16x.Po@am__quote@
@@ -1187,6 +1190,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64ppc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64ppc_fbsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64tilegx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64tilegx_be.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_be.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_chaos.Po@am__quote@
@@ -2608,6 +2612,10 @@ eelf32tilegx.c: $(srcdir)/emulparams/elf32tilegx.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32tilegx "$(tdir_tilegx)"
+eelf32tilegx_be.c: $(srcdir)/emulparams/elf32tilegx_be.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32tilegx_be "$(tdir_tilegx_be)"
eelf32tilepro.c: $(srcdir)/emulparams/elf32tilepro.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -3445,6 +3453,10 @@ eelf64tilegx.c: $(srcdir)/emulparams/elf64tilegx.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf64tilegx "$(tdir_tilegx)"
+eelf64tilegx_be.c: $(srcdir)/emulparams/elf64tilegx_be.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf64tilegx_be "$(tdir_tilegx_be)"
eelf_l1om.c: $(srcdir)/emulparams/elf_l1om.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_l1om "$(tdir_elf_l1om)"
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 8088f2d..f5f7e92 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -654,7 +654,10 @@ tic6x-*-uclinux) targ_emul=elf32_tic6x_linux_le
tic80-*-*) targ_emul=tic80coff
;;
tilegx-*-*) targ_emul=elf64tilegx
- targ_extra_emuls="elf32tilegx"
+ targ_extra_emuls="elf64tilegx_be elf32tilegx elf32tilegx_be"
+ targ_extra_libpath=$targ_extra_emuls ;;
+tilegxbe-*-*) targ_emul=elf64tilegx_be
+ targ_extra_emuls="elf64tilegx elf32tilegx elf32tilegx_be"
targ_extra_libpath=$targ_extra_emuls ;;
tilepro-*-*) targ_emul=elf32tilepro ;;
v850*-*-*) targ_emul=v850
diff --git a/ld/emulparams/elf32tilegx.sh b/ld/emulparams/elf32tilegx.sh
index 0b32262..92121e7 100644
--- a/ld/emulparams/elf32tilegx.sh
+++ b/ld/emulparams/elf32tilegx.sh
@@ -1,5 +1,7 @@
SCRIPT_NAME=elf
-OUTPUT_FORMAT="elf32-tilegx"
+OUTPUT_FORMAT="elf32-tilegx-le"
+BIG_OUTPUT_FORMAT="elf32-tilegx-be"
+LITTLE_OUTPUT_FORMAT="elf32-tilegx-le"
TEXT_START_ADDR=0x10000
NO_REL_RELOCS=yes
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
diff --git a/ld/emulparams/elf32tilegx_be.sh b/ld/emulparams/elf32tilegx_be.sh
new file mode 100644
index 0000000..e3ea498
--- /dev/null
+++ b/ld/emulparams/elf32tilegx_be.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/elf32tilegx.sh
+OUTPUT_FORMAT="elf32-tilegx-be"
diff --git a/ld/emulparams/elf64tilegx.sh b/ld/emulparams/elf64tilegx.sh
index a2c407e..6ac9fa8 100644
--- a/ld/emulparams/elf64tilegx.sh
+++ b/ld/emulparams/elf64tilegx.sh
@@ -1,5 +1,7 @@
SCRIPT_NAME=elf
-OUTPUT_FORMAT="elf64-tilegx"
+OUTPUT_FORMAT="elf64-tilegx-le"
+BIG_OUTPUT_FORMAT="elf64-tilegx-be"
+LITTLE_OUTPUT_FORMAT="elf64-tilegx-le"
TEXT_START_ADDR=0x10000
NO_REL_RELOCS=yes
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
diff --git a/ld/emulparams/elf64tilegx_be.sh b/ld/emulparams/elf64tilegx_be.sh
new file mode 100644
index 0000000..dd0347d
--- /dev/null
+++ b/ld/emulparams/elf64tilegx_be.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/elf64tilegx.sh
+OUTPUT_FORMAT="elf64-tilegx-be"
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 5845e8c..f5eca8c 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2012-02-25 Walter Lee <walt@tilera.com>
+
+ * ld-tilegx/reloc-be.d: New.
+ * ld-tilegx/reloc-le.d: New.
+ * ld-tilegx/reloc.d: Delete.
+ * ld-tilegx/tilegx.exp: Test big and little endian.
+
2012-02-22 Nick Clifton <nickc@redhat.com>
PR ld/13683
diff --git a/ld/testsuite/ld-tilegx/reloc-be.d b/ld/testsuite/ld-tilegx/reloc-be.d
new file mode 100644
index 0000000..7d6f9de
--- /dev/null
+++ b/ld/testsuite/ld-tilegx/reloc-be.d
@@ -0,0 +1,70 @@
+
+.*: file format .*tilegx.*
+
+Contents of section .text:
+ 100b0 .*
+ 100c0 .*
+ 100d0 .*
+ 100e0 .*
+ 100f0 .*
+ 10100 .*
+ 10110 .*
+ 10120 .*
+ 10130 .*
+ 10140 .*
+ 10150 .*
+ 10160 .*
+ 10170 .*
+ 10180 .*
+ 10190 .*
+ 101a0 .*
+ 101b0 .*
+ 101c0 .*
+Contents of section .data:
+ 201e0 000101b8 000101c0 827a4b64 11770000 .*
+ 201f0 0032002e 2c827a12 34567812 3456789a .*
+ 20200 bc123456 789abcde f0000000 00000000 .*
+ 20210 00000000 00000000 00000000 00000000 .*
+
+Disassembly of section .text:
+
+00000000000100b0 <_start>:
+ 100b0: [0-9a-f]* { add r2, zero, zero }
+ 100b8: [0-9a-f]* { j 101b8 <external1> }
+ 100c0: [0-9a-f]* { add r3, r2, r2 }
+ 100c8: [0-9a-f]* { beqzt zero, 101c0 <external2> }
+ 100d0: [0-9a-f]* { movei r2, 17 ; movei r3, 119 }
+ 100d8: [0-9a-f]* { movei r2, 17 ; movei r3, 119 ; ld zero, zero }
+ 100e0: [0-9a-f]* { mtspr 17, zero }
+ 100e8: [0-9a-f]* { mfspr zero, 17 }
+ 100f0: [0-9a-f]* { moveli r2, -32134 ; moveli r3, 19300 }
+ 100f8: [0-9a-f]* { moveli r2, 4660 ; moveli r3, -30293 }
+ 10100: [0-9a-f]* { shl16insli r2, r2, 22136 ; shl16insli r3, r3, -12816 }
+ 10108: [0-9a-f]* { moveli r2, 4660 ; moveli r3, 30292 }
+ 10110: [0-9a-f]* { shl16insli r2, r2, 22136 ; shl16insli r3, r3, 12816 }
+ 10118: [0-9a-f]* { shl16insli r2, r2, -25924 ; shl16insli r3, r3, -292 }
+ 10120: [0-9a-f]* { moveli r2, 4660 ; moveli r3, -292 }
+ 10128: [0-9a-f]* { shl16insli r2, r2, 22136 ; shl16insli r3, r3, -17768 }
+ 10130: [0-9a-f]* { shl16insli r2, r2, -25924 ; shl16insli r3, r3, 30292 }
+ 10138: [0-9a-f]* { shl16insli r2, r2, -8464 ; shl16insli r3, r3, 12816 }
+ 10140: [0-9a-f]* { ld_add r0, r0, 17 }
+ 10148: [0-9a-f]* { st_add r0, r0, 17 }
+ 10150: [0-9a-f]* { mm r2, r3, 19, 31 }
+ 10158: [0-9a-f]* { shli r2, r3, 19 ; shli r4, r5, 31 }
+ 10160: [0-9a-f]* { shli r2, r3, 19 ; shli r4, r5, 31 ; ld zero, zero }
+ 10168: [0-9a-f]* { moveli r0, 80 ; moveli r1, 80 }
+ 10170: [0-9a-f]* { moveli r0, 1 ; moveli r1, 1 }
+ 10178: [0-9a-f]* { moveli r0, 168 ; moveli r1, 168 }
+ 10180: [0-9a-f]* { moveli r0, 4096 ; moveli r1, 4096 }
+ 10188: [0-9a-f]* { moveli r0, 1 ; moveli r1, 1 }
+ 10190: [0-9a-f]* { moveli r0, 144 ; moveli r1, 144 }
+ 10198: [0-9a-f]* { moveli r0, 4096 ; moveli r1, 4096 }
+ 101a0: [0-9a-f]* { moveli r0, 0 ; moveli r1, 0 }
+ 101a8: [0-9a-f]* { moveli r0, 1 ; moveli r1, 1 }
+ 101b0: [0-9a-f]* { moveli r0, 112 ; moveli r1, 112 }
+
+00000000000101b8 <external1>:
+ 101b8: [0-9a-f]* { j 101b8 <external1> }
+
+00000000000101c0 <external2>:
+ 101c0: [0-9a-f]* { j 101b8 <external1> }
diff --git a/ld/testsuite/ld-tilegx/reloc.d b/ld/testsuite/ld-tilegx/reloc-le.d
index c9acdac..8d41bd0 100644
--- a/ld/testsuite/ld-tilegx/reloc.d
+++ b/ld/testsuite/ld-tilegx/reloc-le.d
@@ -1,5 +1,5 @@
-.*: file format elf64-tilegx.*
+.*: file format .*tilegx.*
Contents of section .text:
100b0 .*
diff --git a/ld/testsuite/ld-tilegx/tilegx.exp b/ld/testsuite/ld-tilegx/tilegx.exp
index 856b41e..fbc80a2 100644
--- a/ld/testsuite/ld-tilegx/tilegx.exp
+++ b/ld/testsuite/ld-tilegx/tilegx.exp
@@ -24,14 +24,21 @@ if {!([istarget "tilegx-*-*"]) } {
# Set up a list as described in ld-lib.exp
-set tilepro_tests {
- { "tilegx relocation resolution linker test"
- ""
- ""
+set tilegx_tests {
+ { "tilegx little-endian relocation resolution linker test"
+ "-EL"
+ "-EL"
{ "reloc.s" "external.s" }
- { {objdump -ds reloc.d} }
+ { {objdump -ds reloc-le.d} }
+ "reloc"
+ }
+ { "tilegx big-endian relocation resolution linker test"
+ "-EB"
+ "-EB"
+ { "reloc.s" "external.s" }
+ { {objdump -ds reloc-be.d} }
"reloc"
}
}
-run_ld_link_tests $tilepro_tests
+run_ld_link_tests $tilegx_tests