public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Patch h8300-elf
@ 2003-07-01 12:33 Paul
  2003-07-03 11:12 ` Richard Sandiford
  0 siblings, 1 reply; 5+ messages in thread
From: Paul @ 2003-07-01 12:33 UTC (permalink / raw)
  To: binutils, Richard Sandiford, Nick Clifton

[-- Attachment #1: Type: text/plain, Size: 210 bytes --]

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.

Paul



[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1296 bytes --]

Index: bfd/elf32-h8300.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-h8300.c,v
retrieving revision 1.28
diff -u -4 -r1.28 elf32-h8300.c
--- bfd/elf32-h8300.c	25 Jun 2003 06:40:24 -0000	1.28
+++ bfd/elf32-h8300.c	1 Jul 2003 12:19:53 -0000
@@ -182,9 +182,9 @@
 	 FALSE,			/* pc_relative */
 	 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 */
 	 FALSE),		/* pcrel_offset */
@@ -1074,8 +1074,10 @@
 
 		/* Fix the relocation's type.  */
 		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))
@@ -1186,9 +1188,9 @@
 		bfd_put_8 (abfd, code, contents + irel->r_offset - 1);
 
 		/* 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,
 						  irel->r_offset + 1, 2))

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-07-11 14:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-01 12:33 Patch h8300-elf Paul
2003-07-03 11:12 ` Richard Sandiford
2003-07-04 10:27   ` Nick Clifton
2003-07-11 12:58   ` h8s relaxation patch Richard Sandiford
2003-07-11 14:36     ` Nick Clifton

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).