summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-tic6x
diff options
context:
space:
mode:
authorBernd Schmidt <bernd.schmidt@analog.com>2011-05-20 10:09:57 +0000
committerBernd Schmidt <bernd.schmidt@analog.com>2011-05-20 10:09:57 +0000
commit007790abbb362d0a598901e7fce4742a3d49ad26 (patch)
tree3bdd94f22871ab26c3b4a0f184e26726510c4672 /ld/testsuite/ld-tic6x
parent8981ada0fb407235c5af168912ede90f31e5f9e2 (diff)
downloadbinutils-redhat-007790abbb362d0a598901e7fce4742a3d49ad26.tar.gz
ld/testsuite/
* ld-tic6x/pcr-reloc.d: New test. * ld-tic6x/pcr-reloc.s: New test. gas/testsuite/ * gas/tic6x/pcr-relocs.d: New test. * gas/tic6x/pcr-relocs.s: New test. * gas/tic6x/pcr-relocs-undef.d: New test. * gas/tic6x/pcr-relocs-undef.s: New test. * gas/tic6x/reloc-bad-2.s: Update for pcr_offset. * gas/tic6x/reloc-bad-2.l: Update for pcr_offset. bfd/ * elf32-tic6x.c (elf32_tic6x_howto_table): Add entries for R_C6000_PCR_H16 and R_C6000_PCR_L16. (elf32_tic6x_relocate_section): Handle them. gas/ * config/tc-tic6x.c (tic6x_operators): Add "pcr_offset". (tic6x_parse_name): Handle it. (tic6x_fix_new_exp): Handle O_pcr_offset. (tic6x_fix_adjustable): Return 0 for the new relocs. (md_apply_fix): Handle them. (tc_gen_reloc): Likewise. * config/tc-tic6x.h (tic6x_fix_info): Add a fix_subsy member.
Diffstat (limited to 'ld/testsuite/ld-tic6x')
-rw-r--r--ld/testsuite/ld-tic6x/pcr-reloc.d39
-rw-r--r--ld/testsuite/ld-tic6x/pcr-reloc.s28
2 files changed, 67 insertions, 0 deletions
diff --git a/ld/testsuite/ld-tic6x/pcr-reloc.d b/ld/testsuite/ld-tic6x/pcr-reloc.d
new file mode 100644
index 0000000000..8c35e04589
--- /dev/null
+++ b/ld/testsuite/ld-tic6x/pcr-reloc.d
@@ -0,0 +1,39 @@
+#name: C6X PCR relocations
+#as: -mlittle-endian
+#ld: -melf32_tic6x_le -Tgeneric.ld
+#source: pcr-reloc.s
+#objdump: -dr
+
+.*: *file format elf32-tic6x-le
+
+
+Disassembly of section \.text:
+
+10000000 <[^>]*>:
+10000000:[ \t]+00800264[ \t]+ldw \.D1T1 \*\+a0\(0\),a1
+10000004:[ \t]+00800264[ \t]+ldw \.D1T1 \*\+a0\(0\),a1
+10000008:[ \t]+00800264[ \t]+ldw \.D1T1 \*\+a0\(0\),a1
+
+1000000c <[^>]*>:
+1000000c:[ \t]+004003e2[ \t]+mvc \.S2 pce1,b0
+10000010:[ \t]+01000264[ \t]+ldw \.D1T1 \*\+a0\(0\),a2
+10000014:[ \t]+01001a2a[ \t]+mvk \.S2 52,b2
+10000018:[ \t]+0100006a[ \t]+mvkh \.S2 0,b2
+1000001c:[ \t]+01000a2a[ \t]+mvk \.S2 20,b2
+10000020:[ \t]+0100006a[ \t]+mvkh \.S2 0,b2
+10000024:[ \t]+01001e2a[ \t]+mvk \.S2 60,b2
+10000028:[ \t]+0100006a[ \t]+mvkh \.S2 0,b2
+1000002c:[ \t]+01000e2a[ \t]+mvk \.S2 28,b2
+10000030:[ \t]+0100006a[ \t]+mvkh \.S2 0,b2
+
+10000034 <[^>]*>:
+10000034:[ \t]+00800264[ \t]+ldw \.D1T1 \*\+a0\(0\),a1
+
+10000038 <[^>]*>:
+10000038:[ \t]+004003e2[ \t]+mvc \.S2 pce1,b0
+
+1000003c <[^>]*>:
+1000003c:[ \t]+00800264[ \t]+ldw \.D1T1 \*\+a0\(0\),a1
+10000040:[ \t]+017ff02a[ \t]+mvk \.S2 -32,b2
+10000044:[ \t]+017fffea[ \t]+mvkh \.S2 4294901760,b2
+[ \t]*\.\.\.
diff --git a/ld/testsuite/ld-tic6x/pcr-reloc.s b/ld/testsuite/ld-tic6x/pcr-reloc.s
new file mode 100644
index 0000000000..00362ffe34
--- /dev/null
+++ b/ld/testsuite/ld-tic6x/pcr-reloc.s
@@ -0,0 +1,28 @@
+ .text
+ .align 5
+_start:
+L0:
+ ldw .d1t1 *a0,a1
+ ldw .d1t1 *a0,a1
+ ldw .d1t1 *a0,a1
+L1:
+ MVC .s2 PCE1, b0
+ ldw .d1t1 *a0,a2
+ mvk .s2 $PCR_OFFSET (S0,L1), b2
+ mvkh .s2 $PCR_OFFSET (S0,L1), b2
+ mvk .s2 $PCR_OFFSET (S0,L2), b2
+ mvkh .s2 $PCR_OFFSET (S0,L2), b2
+ mvk .s2 $PCR_OFFSET (S1,L1), b2
+ mvkh .s2 $PCR_OFFSET (S1,L1), b2
+ mvk .s2 $PCR_OFFSET (S1,L2), b2
+ mvkh .s2 $PCR_OFFSET (S1,L2), b2
+
+S0:
+ ldw .d1t1 *a0,a1
+L2:
+ MVC .s2 PCE1, b0
+
+S1:
+ ldw .d1t1 *a0,a1
+ mvkl .s2 $PCR_OFFSET (L0,L2), b2
+ mvkh .s2 $PCR_OFFSET (L0,L2), b2