From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20290 invoked by alias); 20 Mar 2012 15:11:03 -0000 Received: (qmail 20270 invoked by uid 22791); 20 Mar 2012 15:11:01 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,FROM_12LTRDOM,TW_XF X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Mar 2012 15:10:27 +0000 Received: from nat-dem.mentorg.com ([195.212.93.2] helo=eu2-mail.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1SA0hc-00000k-9L from Thomas_Schwinge@mentor.com ; Tue, 20 Mar 2012 08:10:24 -0700 Received: from feldtkeller.schwinge.homeip.net ([172.30.64.78]) by eu2-mail.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 20 Mar 2012 16:10:22 +0100 From: Thomas Schwinge To: binutils@sourceware.org, Alexandre Oliva , Kaz Kojima Cc: gdb-patches@sourceware.org, Kevin Buettner Subject: [SH] .8byte directive (for DWARF data) User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Tue, 20 Mar 2012 15:11:00 -0000 Message-ID: <87vclzgvfx.fsf@schwinge.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-03/txt/msg00740.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 3108 Hi! On SH, GDB's gdb.dwarf2/dw2-intermix.exp currently fails as follows: Running [GDB]/testsuite/gdb.dwarf2/dw2-intermix.exp ... gdb compile failed, [GDB]/testsuite/gdb.dwarf2/dw2-intermix.S: Assemble= r messages: [GDB]/testsuite/gdb.dwarf2/dw2-intermix.S:139: Error: unsupported BFD r= elocation size 8 [GDB]/testsuite/gdb.dwarf2/dw2-intermix.S:142: Error: unsupported BFD r= elocation size 8 gdb.dwarf2/dw2-intermix.S: [...] 18 /* Test a minimal file containing intermixed 32-bit and 64-bit D= WARF 19 formats. This is not allowed by the (draft) DWARF-3 standard= , but 20 GDB should handle it gracefully nevertheless. */ [...] 135 /* Line table */ 136 .section .debug_line 137 .Lline1_begin: 138 .4byte 0xffffffff 139 .8byte .Lline1_end - .Lline1_start /* Initial length */ 140 .Lline1_start: 141 .2byte 2 /* Version */ 142 .8byte .Lline1_lines - .Lline1_hdr /* header_length */ 143 .Lline1_hdr: 144 .byte 1 /* Minimum insn length */ [...] Here is a patch for the assembler, OK to commit? gas/ [SH] Support the .8byte directive also for non-sh64 configurations. * config/tc-sh.c (sh_cons_fix_new, md_apply_fix) [!HAVE_SH64]: Handle BFD_RELOC_64. Index: gas/config/tc-sh.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gas/config/tc-sh.c,v retrieving revision 1.139 diff -u -p -r1.139 tc-sh.c --- gas/config/tc-sh.c 28 Jun 2010 14:06:57 -0000 1.139 +++ gas/config/tc-sh.c 15 Mar 2012 12:00:13 -0000 @@ -789,11 +789,9 @@ sh_cons_fix_new (fragS *frag, int off, i r_type =3D BFD_RELOC_32; break; =20 -#ifdef HAVE_SH64 case 8: r_type =3D BFD_RELOC_64; break; -#endif =20 default: goto error; @@ -3968,6 +3966,11 @@ md_apply_fix (fixS *fixP, valueT *valP,=20 the other symbol. We have to adjust the relocation type here. */ if (fixP->fx_pcrel) { +#ifndef HAVE_SH64 + /* Safeguard; this must not occur for non-sh64 configurations. */ + gas_assert (fixP->fx_r_type !=3D BFD_RELOC_64); +#endif + switch (fixP->fx_r_type) { default: @@ -4166,6 +4169,12 @@ md_apply_fix (fixS *fixP, valueT *valP,=20 buf[highbyte] |=3D (val >> 8) & 0xf; break; =20 +#ifndef HAVE_SH64 + case BFD_RELOC_64: + apply_full_field_fix (fixP, buf, *valP, 8); + break; +#endif + case BFD_RELOC_32: case BFD_RELOC_32_PCREL: apply_full_field_fix (fixP, buf, val, 4); This obviously doesn't change anything for sh64 configurations, and causes no regressions all of sh-linux-gnu toolchain testing (SH4a), and the GDB testresults then look as follows: Running [GDB]/testsuite/gdb.dwarf2/dw2-intermix.exp ... PASS: gdb.dwarf2/dw2-intermix.exp: set listsize 1 PASS: gdb.dwarf2/dw2-intermix.exp: list func_cu1 PASS: gdb.dwarf2/dw2-intermix.exp: ptype func_cu1 Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature Content-length: 489 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJPaJ3TAAoJENuKOtuXzphJt+YH/AyaiU7zCnAtu8LMxHBKv5fS njhmdFybxM6XOflw/1TlcmH4wrFAxtPHbS9xUE5ZE3a/WOsm3bfv97pxF2rWcJmn z+UF4c0WPszq5Xh/nxgXaQXhEQUWLI3MxiRJ+Rdb/8jUK4dAx6WNrRkdPCiMQgIA N/seGQICeDGv08qDKZ/fkFHFunRcFVGUY+zHMPbcdT4PISPQHEgQeSoH2S9EcQcM pMj59osC5kvugFDo6LjbuYLIVg9l2Kz95y7g2B7UKbIXPc2x0t5EKUCyZnThQh4V 6t0GKfM+/3C2bYKsumhFjEROCC50KRJc8Pb3IUqc5Rn84uoWTKq+cNjRrnJCwbk= =M4vk -----END PGP SIGNATURE----- --=-=-=--