aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2004-12-16 16:56:04 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2004-12-16 16:56:04 +0000
commit1e50d24d553250622687bbc21027e8bfdb31870f (patch)
treec66a5fff096c41f49cd675874937fafe98209022 /ld
parent2fbd2a87e2cd23eba4eae6341661ce0149be08b1 (diff)
downloadfsf-binutils-gdb-1e50d24d553250622687bbc21027e8bfdb31870f.zip
fsf-binutils-gdb-1e50d24d553250622687bbc21027e8bfdb31870f.tar.gz
fsf-binutils-gdb-1e50d24d553250622687bbc21027e8bfdb31870f.tar.bz2
include/elf/
* v850.h (R_V850_LO16_SPLIT_OFFSET): New reloc. bfd/ * reloc.c (BFD_RELOC_V850_LO16_SPLIT_OFFSET): New bfd_reloc_code_type. * elf32-v850.c (v850_elf_howto_table): Add entry for R_V850_LO16_SPLIT_OFFSET. (v850_elf_reloc_map): Map it to BFD_RELOC_V850_LO16_SPLIT_OFFSET. (v850_elf_perform_lo16_relocation): New function, extracted from... (v850_elf_perform_relocation): ...here. Use it to handle R_V850_LO16_SPLIT_OFFSET. (v850_elf_check_relocs, v850_elf_final_link_relocate): Handle R_V850_LO16_SPLIT_OFFSET. * libbfd.h, bfd-in2.h: Regenerate. gas/ * config/tc-v850.c (handle_lo16): New function. (v850_reloc_prefix): Use it to check lo(). (md_assemble, md_apply_fix3): Handle BFD_RELOC_V850_LO16_SPLIT_OFFSET. gas/testsuite/ * gas/v850/split-lo16.{s,d}: New test. * gas/v850/v850.exp: Run it. ld/testsuite/ * ld-v850: New directory.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog4
-rw-r--r--ld/testsuite/ld-v850/split-lo16.d26
-rw-r--r--ld/testsuite/ld-v850/split-lo16.ld11
-rw-r--r--ld/testsuite/ld-v850/split-lo16.s20
-rw-r--r--ld/testsuite/ld-v850/v850.exp3
5 files changed, 64 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index cbf50fc..d817a22 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2004-12-16 Richard Sandiford <rsandifo@redhat.com>
+
+ * ld-v850: New directory.
+
2004-12-14 Richard Sandiford <rsandifo@redhat.com>
* ld-mips-elf/jal-overflow-2.[sd]: New test.
diff --git a/ld/testsuite/ld-v850/split-lo16.d b/ld/testsuite/ld-v850/split-lo16.d
new file mode 100644
index 0000000..c5668ff
--- /dev/null
+++ b/ld/testsuite/ld-v850/split-lo16.d
@@ -0,0 +1,26 @@
+#source: split-lo16.s -mv850e
+#ld: -Tsplit-lo16.ld
+#objdump: -d
+#...
+00010000 <.*>:
+ 10000: 40 0e 34 12 movhi 4660, r0, r1
+ 10004: 01 16 78 56 addi 22136, r1, r2
+ 10008: 81 17 79 56 ld\.bu 22136\[r1\],r2
+ 1000c: 40 0e 36 12 movhi 4662, r0, r1
+ 10010: 01 16 78 d8 addi -10120, r1, r2
+ 10014: 81 17 79 d8 ld\.bu -10120\[r1\],r2
+ 10018: 40 0e 12 00 movhi 18, r0, r1
+ 1001c: 81 17 57 34 ld\.bu 13398\[r1\],r2
+ 10020: 01 16 56 34 addi 13398, r1, r2
+ 10024: 40 0e 14 00 movhi 20, r0, r1
+ 10028: 81 17 57 b6 ld\.bu -18858\[r1\],r2
+ 1002c: 01 16 56 b6 addi -18858, r1, r2
+ 10030: 40 0e 79 56 movhi 22137, r0, r1
+ 10034: 01 16 bc 9a addi -25924, r1, r2
+ 10038: 81 17 bd 9a ld\.bu -25924\[r1\],r2
+ 1003c: 40 0e 9b 78 movhi 30875, r0, r1
+ 10040: 81 17 df bc ld\.bu -17186\[r1\],r2
+ 10044: 01 16 de bc addi -17186, r1, r2
+ 10048: 40 0e 45 23 movhi 9029, r0, r1
+ 1004c: a1 17 89 67 ld\.bu 26505\[r1\],r2
+#pass
diff --git a/ld/testsuite/ld-v850/split-lo16.ld b/ld/testsuite/ld-v850/split-lo16.ld
new file mode 100644
index 0000000..bde9063
--- /dev/null
+++ b/ld/testsuite/ld-v850/split-lo16.ld
@@ -0,0 +1,11 @@
+SECTIONS
+{
+ lo16_carry = 0x56789abc;
+ lo16_nocarry = 0x12345678;
+ split_lo16_carry = 0x789abcde;
+ split_lo16_nocarry = 0x00123456;
+ odd = 0x23456789;
+ . = 0x10000;
+ .text : { *(.text); }
+ /DISCARD/ : { *(*); }
+}
diff --git a/ld/testsuite/ld-v850/split-lo16.s b/ld/testsuite/ld-v850/split-lo16.s
new file mode 100644
index 0000000..7eaae41
--- /dev/null
+++ b/ld/testsuite/ld-v850/split-lo16.s
@@ -0,0 +1,20 @@
+ movhi hi(lo16_nocarry),r0,r1
+ addi lo(lo16_nocarry),r1,r2
+ ld.bu lo(lo16_nocarry)[r1],r2
+ movhi hi(lo16_nocarry + 0x18200),r0,r1
+ addi lo(lo16_nocarry + 0x18200),r1,r2
+ ld.bu lo(lo16_nocarry + 0x18200)[r1],r2
+ movhi hi(split_lo16_nocarry),r0,r1
+ ld.bu lo(split_lo16_nocarry)[r1],r2
+ addi lo(split_lo16_nocarry),r1,r2
+ movhi hi(split_lo16_nocarry + 0x18200),r0,r1
+ ld.bu lo(split_lo16_nocarry + 0x18200)[r1],r2
+ addi lo(split_lo16_nocarry + 0x18200),r1,r2
+ movhi hi(lo16_carry),r0,r1
+ addi lo(lo16_carry),r1,r2
+ ld.bu lo(lo16_carry)[r1],r2
+ movhi hi(split_lo16_carry),r0,r1
+ ld.bu lo(split_lo16_carry)[r1],r2
+ addi lo(split_lo16_carry),r1,r2
+ movhi hi(odd),r0,r1
+ ld.bu lo(odd)[r1],r2
diff --git a/ld/testsuite/ld-v850/v850.exp b/ld/testsuite/ld-v850/v850.exp
new file mode 100644
index 0000000..59f184a
--- /dev/null
+++ b/ld/testsuite/ld-v850/v850.exp
@@ -0,0 +1,3 @@
+if [istarget v850*-*-*] {
+ run_dump_test "split-lo16"
+}