* [PATCH]: Fix savannah/3331: Invalid group relaxation, bset uses an invalid address (HC11)
@ 2003-04-26 11:59 Stephane Carrez
0 siblings, 0 replies; only message in thread
From: Stephane Carrez @ 2003-04-26 11:59 UTC (permalink / raw)
To: binutils
[-- Attachment #1: Type: text/plain, Size: 644 bytes --]
Hi!
I've committed this patch to fix an invalid relaxation that is activated on HC11,
this bug is registered in Savannah:
Bug #3331: Invalid group relaxation, bset uses an invalid address
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=3331&group_id=2424
I also added a testcase in the LD testsuite to show/check the fix.
Stephane
2003-04-26 Stephane Carrez <stcarrez@nerim.fr>
PR savannah/3331:
* elf32-m68hc11.c (m68hc11_elf_relax_section): Clear prev_insn_group
when we couldn't relax something.
2003-04-26 Stephane Carrez <stcarrez@nerim.fr>
* ld-m68hc11/bug-3331.d: New test.
* ld-m68hc11/bug-3331.s: New file.
[-- Attachment #2: bug.diffs --]
[-- Type: text/plain, Size: 2021 bytes --]
Index: bfd/elf32-m68hc11.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m68hc11.c,v
retrieving revision 1.17
diff -u -p -r1.17 elf32-m68hc11.c
--- bfd/elf32-m68hc11.c 21 Apr 2003 13:22:14 -0000 1.17
+++ bfd/elf32-m68hc11.c 26 Apr 2003 11:52:28 -0000
@@ -1073,6 +1073,7 @@ m68hc11_elf_relax_section (abfd, sec, li
}
}
prev_insn_branch = 0;
+ prev_insn_group = 0;
}
if (free_relocs != NULL)
Index: ld/testsuite/ld-m68hc11/bug-3331.d
===================================================================
RCS file: ld/testsuite/ld-m68hc11/bug-3331.d
diff -N ld/testsuite/ld-m68hc11/bug-3331.d
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-m68hc11/bug-3331.d 26 Apr 2003 11:52:28 -0000
@@ -0,0 +1,14 @@
+#source: bug-3331.s
+#as: -m68hc11
+#ld: --relax
+#objdump: -d --prefix-addresses -r
+#target: m6811-*-* m6812-*-*
+
+.*: +file format elf32-m68hc11
+
+Disassembly of section .text:
+0+8000 <_start> ldx #0+1100 <__data_section_start>
+0+8003 <_start\+0x3> bset 0,x \#\$04
+0+8006 <L1> ldd \#0+2 <__bss_size\+0x2>
+0+8009 <L1\+0x3> std \*0+ <__bss_size>
+0+800b <L1\+0x5> rts
Index: ld/testsuite/ld-m68hc11/bug-3331.s
===================================================================
RCS file: ld/testsuite/ld-m68hc11/bug-3331.s
diff -N ld/testsuite/ld-m68hc11/bug-3331.s
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-m68hc11/bug-3331.s 26 Apr 2003 11:52:28 -0000
@@ -0,0 +1,23 @@
+;;; Bug #3331: Invalid group relaxation, bset uses an invalid address
+;;; http://savannah.gnu.org/bugs/?func=detailbug&bug_id=3331&group_id=2424
+;;;
+ .sect .text
+ .globl _start
+_start:
+ .relax L1
+ ldx #foo ;; This relax group must not be changed.
+ bset 0,x #4
+L1:
+ ldd #2
+ std table ;; This instruction uses a symbol in page0
+ ;; and it triggered the relaxation of the
+ ;; previous relax group
+ rts
+
+ .sect .page0
+ .globl table
+table: .long 0
+
+ .sect .data
+ .globl foo
+foo: .long 0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-04-26 11:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-26 11:59 [PATCH]: Fix savannah/3331: Invalid group relaxation, bset uses an invalid address (HC11) Stephane Carrez
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).