From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7244 invoked by alias); 12 Nov 2004 12:26:22 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 7042 invoked from network); 12 Nov 2004 12:26:07 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 12 Nov 2004 12:26:07 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id iACCQ7Or028446 for ; Fri, 12 Nov 2004 07:26:07 -0500 Received: from pobox.surrey.redhat.com (pobox.surrey.redhat.com [172.16.10.17]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id iACCQ2r27809 for ; Fri, 12 Nov 2004 07:26:02 -0500 Received: from localhost.localdomain.redhat.com (vpnuser6.surrey.redhat.com [172.16.9.6]) by pobox.surrey.redhat.com (8.12.8/8.12.8) with ESMTP id iACCQ0jY008813 for ; Fri, 12 Nov 2004 12:26:01 GMT To: binutils@sources.redhat.com Subject: Patch: Fix off-by-one error in tc-mn10300.c relax table From: Nick Clifton Date: Fri, 12 Nov 2004 12:26:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-11/txt/msg00205.txt.bz2 Hi Guys, I am applying the patch below to fix a relaxation problem with the MN10300 port recently reported by one of our customers. The md_relax_table has a couple of offsets that are off by one. The patch fixes this and also adds a test to the gas testsuite to make sure that the problem remains fixed. Cheers Nick gas/ChangeLog 2004-11-12 Nick Clifton * config/tc-mn10300.c (md_relax_table): Fix off by one negative offsets for conditional branches. gas/testsuite/ChangeLog 2004-11-12 Nick Clifton * gas/mn10300/basic.exp: Add relax test. * gas/mn10300/relax.s: New test. * gas/mn10300/relax.d: Expected results. Make sure that the correct size of instruction has been selected. Index: gas/config/tc-mn10300.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-mn10300.c,v retrieving revision 1.47 diff -c -3 -p -r1.47 tc-mn10300.c *** gas/config/tc-mn10300.c 28 May 2004 21:33:07 -0000 1.47 --- gas/config/tc-mn10300.c 12 Nov 2004 12:22:13 -0000 *************** const char FLT_CHARS[] = "dD"; *** 57,68 **** const relax_typeS md_relax_table[] = { /* bCC relaxing */ {0x7f, -0x80, 2, 1}, ! {0x7fff, -0x8000, 5, 2}, {0x7fffffff, -0x80000000, 7, 0}, /* bCC relaxing (uncommon cases) */ {0x7f, -0x80, 3, 4}, ! {0x7fff, -0x8000, 6, 5}, {0x7fffffff, -0x80000000, 8, 0}, /* call relaxing */ --- 57,68 ---- const relax_typeS md_relax_table[] = { /* bCC relaxing */ {0x7f, -0x80, 2, 1}, ! {0x7fff, -0x8000 + 1, 5, 2}, {0x7fffffff, -0x80000000, 7, 0}, /* bCC relaxing (uncommon cases) */ {0x7f, -0x80, 3, 4}, ! {0x7fff, -0x8000 + 1, 6, 5}, {0x7fffffff, -0x80000000, 8, 0}, /* call relaxing */ *************** const relax_typeS md_relax_table[] = { *** 80,86 **** /* fbCC relaxing */ {0x7f, -0x80, 3, 14}, ! {0x7fff, -0x8000, 6, 15}, {0x7fffffff, -0x80000000, 8, 0}, }; --- 80,86 ---- /* fbCC relaxing */ {0x7f, -0x80, 3, 14}, ! {0x7fff, -0x8000 + 1, 6, 15}, {0x7fffffff, -0x80000000, 8, 0}, }; Index: gas/testsuite/gas/mn10300/basic.exp =================================================================== RCS file: /cvs/src/src/gas/testsuite/gas/mn10300/basic.exp,v retrieving revision 1.9 diff -c -3 -p -r1.9 basic.exp *** gas/testsuite/gas/mn10300/basic.exp 16 Jan 2004 03:16:07 -0000 1.9 --- gas/testsuite/gas/mn10300/basic.exp 12 Nov 2004 12:22:14 -0000 *************** if [istarget mn10300*-*-*] then { *** 1817,1820 **** --- 1817,1821 ---- run_list_test "movpc" "" run_dump_test "am33-2" + run_dump_test "relax" } Index: gas/testsuite/gas/mn10300/relax.s =================================================================== 0a1,32 > .am33_2 > > .section .rlcb, "ax" > .global relax_long_cond_branch > relax_long_cond_branch: > clr d0 > clr d1 > .L2: > add d1,d0 > inc d1 > > .fill 32764, 1, 0xcb > > cmp 9,d1 > ble .L2 > rets > > > .section .rsflb, "ax" > .global relax_long_float_cond_branch > relax_long_float_cond_branch: > clr d0 > clr d1 > .L4: > add d1,d0 > inc d1 > > .fill 32764, 1, 0xcb > > cmp 9,d1 > fble .L4 > rets Index: gas/testsuite/gas/mn10300/relax.d =================================================================== 0a1,17 > #objdump: -r > #name: Relaxation of conditional branches > > .*: +file format.*elf32-[am33lin|mn10300].* > > RELOCATION RECORDS FOR \[.rlcb\]: > OFFSET TYPE VALUE > 0+8003 R_MN10300_PCREL8 .L0._0\+0x00000001 > 0+8005 R_MN10300_PCREL32 .L2\+0x00000001 > > > RELOCATION RECORDS FOR \[.rsflb\]: > OFFSET TYPE VALUE > 0+8004 R_MN10300_PCREL8 .L0._1\+0x00000002 > 0+8006 R_MN10300_PCREL32 .L4\+0x00000001 > >