From: Richard Sandiford <rsandifo@redhat.com>
To: Paul <paulc@senet.com.au>
Cc: binutils@sources.redhat.com, Nick Clifton <nickc@redhat.com>
Subject: Re: Patch h8300-elf
Date: Thu, 03 Jul 2003 11:12:00 -0000 [thread overview]
Message-ID: <wvny8zfyiim.fsf@talisman.cambridge.redhat.com> (raw)
In-Reply-To: <3F017E7C.1050609@senet.com.au>
Paul <paulc@senet.com.au> writes:
> There is a bug in h8300-elf when relaxing, a word access to an 8 bit area
> would get an invalid 8 bit relocation. The minimum addressing mode for
> a word access is 16 bits. This patch fixes the problem.
This looks good to me but (having turned down the maintainership,
at least for now) I'm not in a position to approve it.
One thing though: you didn't include a ChangeLog entry. I'd suggest
something like:
* 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.
FWIW, I've attached a dejagnu testcase that fails before your patch and
passes afterwards. The patch also fixes a couple of things in the
relax.d test.
Tested on h8300-elf and h8300-coff.
BTW, I notice that the range checks are wrong for h8s & h8sx.
I'll try to fix that soon.
Richard
* 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.
Index: ld/testsuite/ld-h8300/h8300.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-h8300/h8300.exp,v
retrieving revision 1.1
diff -c -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.1 h8300.exp
*** ld/testsuite/ld-h8300/h8300.exp 15 Nov 2002 11:18:49 -0000 1.1
--- ld/testsuite/ld-h8300/h8300.exp 3 Jul 2003 10:45:11 -0000
*************** if ![istarget h8300-*-*] {
*** 24,32 ****
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]
}
--- 24,31 ----
return
}
! run_dump_test relax
!
! if {[istarget *-elf]} {
! run_dump_test relax-2
}
Index: ld/testsuite/ld-h8300/relax.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-h8300/relax.d,v
retrieving revision 1.1
diff -c -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.1 relax.d
*** ld/testsuite/ld-h8300/relax.d 15 Nov 2002 11:18:49 -0000 1.1
--- ld/testsuite/ld-h8300/relax.d 3 Jul 2003 10:45:11 -0000
***************
*** 1,4 ****
! # name: H8300 Relxation Test
# ld: --relax
# objdump: -d --no-show-raw-insn
--- 1,4 ----
! # name: H8300 Relaxation Test
# ld: --relax
# objdump: -d --no-show-raw-insn
*************** Disassembly of section .text:
*** 11,18 ****
00000100 <_start>:
100: 0d 00 mov.w r0,r0
! 102: 47 02 beq .+2 \(106\)
! 104: 55 02 bsr .+2 \(108\)
00000106 <.L1>:
106: 54 70 rts
--- 11,18 ----
00000100 <_start>:
100: 0d 00 mov.w r0,r0
! 102: 47 02 beq .+2 \(0x106\)
! 104: 55 02 bsr .+2 \(0x108\)
00000106 <.L1>:
106: 54 70 rts
*** /dev/null Tue Jun 17 23:06:41 2003
--- ld/testsuite/ld-h8300/relax-2.d Thu Jul 3 11:53:27 2003
***************
*** 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
*** /dev/null Tue Jun 17 23:06:41 2003
--- ld/testsuite/ld-h8300/relax-2.s Thu Jul 3 11:49:10 2003
***************
*** 0 ****
--- 1,8 ----
+ .h8300h
+ .globl _start
+ _start:
+ mov.b @foo:16,r0l
+ mov.b @bar:32,r0l
+
+ .equ foo,0xffff67
+ .equ bar,0x4321
next prev parent reply other threads:[~2003-07-03 11:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-01 12:33 Paul
2003-07-03 11:12 ` Richard Sandiford [this message]
2003-07-04 10:27 ` Nick Clifton
2003-07-11 12:58 ` h8s relaxation patch Richard Sandiford
2003-07-11 14:36 ` Nick Clifton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wvny8zfyiim.fsf@talisman.cambridge.redhat.com \
--to=rsandifo@redhat.com \
--cc=binutils@sources.redhat.com \
--cc=nickc@redhat.com \
--cc=paulc@senet.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).