diff options
author | Stephane Carrez <stcarrez@nerim.fr> | 2003-04-26 11:53:36 +0000 |
---|---|---|
committer | Stephane Carrez <stcarrez@nerim.fr> | 2003-04-26 11:53:36 +0000 |
commit | d204f4c0f9c93e87dfd814795909e19726e14223 (patch) | |
tree | 70a193810c724e61574490156dad264febce8553 | |
parent | aaa222e7b029c17f562198fc520f485dbc3646c5 (diff) | |
download | fsf-binutils-gdb-d204f4c0f9c93e87dfd814795909e19726e14223.zip fsf-binutils-gdb-d204f4c0f9c93e87dfd814795909e19726e14223.tar.gz fsf-binutils-gdb-d204f4c0f9c93e87dfd814795909e19726e14223.tar.bz2 |
PR savannah/3331:
* elf32-m68hc11.c (m68hc11_elf_relax_section): Clear prev_insn_group
when we couldn't relax something.
* ld-m68hc11/bug-3331.d: New test.
* ld-m68hc11/bug-3331.s: New file.
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf32-m68hc11.c | 1 | ||||
-rw-r--r-- | ld/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-m68hc11/bug-3331.d | 14 | ||||
-rw-r--r-- | ld/testsuite/ld-m68hc11/bug-3331.s | 23 |
5 files changed, 49 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 10a5957..faa6e11 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +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-25 Alan Modra <amodra@bigpond.net.au> * elflink.h (elf_merge_symbol): When we find a regular definition diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c index ebd9d42..bb0f9e9 100644 --- a/bfd/elf32-m68hc11.c +++ b/bfd/elf32-m68hc11.c @@ -1073,6 +1073,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again) } } prev_insn_branch = 0; + prev_insn_group = 0; } if (free_relocs != NULL) diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index ef513cf..a0ae7fd 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-04-26 Stephane Carrez <stcarrez@nerim.fr> + + * ld-m68hc11/bug-3331.d: New test. + * ld-m68hc11/bug-3331.s: New file. + 2003-04-25 Nick Clifton <nickc@redhat.com> J"orn Rennecke <joern.rennecke@superh.com> diff --git a/ld/testsuite/ld-m68hc11/bug-3331.d b/ld/testsuite/ld-m68hc11/bug-3331.d new file mode 100644 index 0000000..91050bf --- /dev/null +++ b/ld/testsuite/ld-m68hc11/bug-3331.d @@ -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 diff --git a/ld/testsuite/ld-m68hc11/bug-3331.s b/ld/testsuite/ld-m68hc11/bug-3331.s new file mode 100644 index 0000000..19a3201 --- /dev/null +++ b/ld/testsuite/ld-m68hc11/bug-3331.s @@ -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 |