* elf32-h8300.c (R_H8_DIR32A16): Fix name field.
authorNick Clifton <nickc@redhat.com>
Fri, 4 Jul 2003 10:25:14 +0000 (10:25 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 4 Jul 2003 10:25:14 +0000 (10:25 +0000)
(elf32_h8_relax_section) <R_H8_DIR16A8>: Adjust position of relocation.
<R_H8_DIR32A16>: Fix type of relocation.

* ld-h8300/h8300.exp: Replace loop with explicit list.  Run relax.d
unconditionally.  Run relax-2.d for *-elf targets.
* ld-h8300/relax.d: Fix typo.
* ld-h8300/relax.s: Add 0x prefixes.
* ld-h8300/relad-2.[sd]: New test.

bfd/ChangeLog
bfd/elf32-h8300.c
ld/testsuite/ChangeLog
ld/testsuite/ld-h8300/h8300.exp
ld/testsuite/ld-h8300/relax-2.d [new file with mode: 0644]
ld/testsuite/ld-h8300/relax-2.s [new file with mode: 0644]
ld/testsuite/ld-h8300/relax.d

index be245f0c5c7a3bc34c665e5907859a3b8e4dda5e..712976c2a035e30cde93ce4ea5530458412a7bf9 100644 (file)
@@ -1,3 +1,9 @@
+2003-07-04  Paul  <paulc@senet.com.au>
+
+       * elf32-h8300.c (R_H8_DIR32A16): Fix name field.
+       (elf32_h8_relax_section) <R_H8_DIR16A8>: Adjust position of relocation.
+       <R_H8_DIR32A16>: Fix type of relocation.
+
 2003-07-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
 
        * elf32-sh.c (sh_elf_create_dynamic_sections): Return if dynamic
index 1b623f27f21edc6df3578956589cba0e0952ec01..386c92ff241c3b91561eb56e37ab6f67eaa46bbc 100644 (file)
@@ -183,7 +183,7 @@ static reloc_howto_type h8_elf_howto_table[] = {
         0,                     /* bitpos */
         complain_overflow_dont,/* complain_on_overflow */
         special,               /* special_function */
-        "R_H8_DIR32",          /* name */
+        "R_H8_DIR32A16",       /* name */
         FALSE,                 /* partial_inplace */
         0,                     /* src_mask */
         0xffffffff,            /* dst_mask */
@@ -1076,6 +1076,9 @@ elf32_h8_relax_section (abfd, sec, link_info, again)
                irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
                                             R_H8_DIR8);
 
+               /* Move the relocation.  */
+               irel->r_offset--;
+
                /* Delete two bytes of data.  */
                if (!elf32_h8_relax_delete_bytes (abfd, sec,
                                                  irel->r_offset + 1, 2))
@@ -1187,7 +1190,7 @@ elf32_h8_relax_section (abfd, sec, link_info, again)
 
                /* Fix the relocation's type.  */
                irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
-                                            R_H8_DIR16A8);
+                                            R_H8_DIR16);
 
                /* Delete two bytes of data.  */
                if (!elf32_h8_relax_delete_bytes (abfd, sec,
index a9ad45f4f7baa1fbe58621a4cf1fea7245b15ab3..d7149f8b0d462a3f41f4894874ccbdb0a6176bab 100644 (file)
@@ -1,3 +1,11 @@
+2003-07-04  Richard Sandiford  <rsandifo@redhat.com>
+
+       * ld-h8300/h8300.exp: Replace loop with explicit list.  Run relax.d
+       unconditionally.  Run relax-2.d for *-elf targets.
+       * ld-h8300/relax.d: Fix typo.
+       * ld-h8300/relax.s: Add 0x prefixes.
+       * ld-h8300/relad-2.[sd]: New test.
+
 2003-06-29  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
 
        * ld-mips-elf/mips-elf.exp: Use is_elf_format.
index 99542f48ed838b553a45349c7cca029ed5cadcf5..af457abe2354c7cac89d96d27e3e3aa7072d56d0 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for ld-h8300 tests
-# Copyright 2002 Free Software Foundation, Inc.
+# Copyright 2002, 2003 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -24,9 +24,8 @@ if ![istarget h8300-*-*] {
     return
 }
 
-set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
-foreach test $test_list {
-    # We need to strip the ".d", but can leave the dirname.
-    verbose [file rootname $test]
-    run_dump_test [file rootname $test]
+run_dump_test relax
+
+if {[istarget *-elf]} {
+    run_dump_test relax-2
 }
diff --git a/ld/testsuite/ld-h8300/relax-2.d b/ld/testsuite/ld-h8300/relax-2.d
new file mode 100644 (file)
index 0000000..d32c5b4
--- /dev/null
@@ -0,0 +1,11 @@
+# name: H8300 Relaxation Test 2
+# ld: --relax -m h8300helf
+# objdump: -d --no-show-raw-insn
+
+.*:     file format .*-h8300
+
+Disassembly of section .text:
+
+00000100 <_start>:
+ *100: 28 67       * mov.b     @0x67:8,r0l
+ *102: 6a 08 43 21 * mov.b     @0x4321:16,r0l
diff --git a/ld/testsuite/ld-h8300/relax-2.s b/ld/testsuite/ld-h8300/relax-2.s
new file mode 100644 (file)
index 0000000..aa82dba
--- /dev/null
@@ -0,0 +1,8 @@
+       .h8300h
+       .globl  _start
+_start:
+       mov.b   @foo:16,r0l
+       mov.b   @bar:32,r0l
+
+       .equ    foo,0xffff67
+       .equ    bar,0x4321
index a5672a5ee2361914bee3ecd9e2e7c99183700cea..2bf61c7e2123c6aa7d612b8e661c4da23fc89ece 100644 (file)
@@ -1,4 +1,4 @@
-# name: H8300 Relxation Test
+# name: H8300 Relaxation Test
 # ld: --relax
 # objdump: -d --no-show-raw-insn
 
@@ -11,8 +11,8 @@ Disassembly of section .text:
 
 00000100 <_start>:
  100:  0d 00             mov.w r0,r0
- 102:  47 02             beq   .+2 \(106\)
- 104:  55 02             bsr   .+2 \(108\)
+ 102:  47 02             beq   .+2 \(0x106\)
+ 104:  55 02             bsr   .+2 \(0x108\)
 
 00000106 <.L1>:
  106:  54 70             rts   
This page took 0.033594 seconds and 4 git commands to generate.