From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23325 invoked by alias); 26 Dec 2011 17:11:50 -0000 Received: (qmail 23317 invoked by uid 22791); 26 Dec 2011 17:11:49 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from lon1-post-1.mail.demon.net (HELO lon1-post-1.mail.demon.net) (195.173.77.148) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Dec 2011 17:11:34 +0000 Received: from jsm-net.demon.co.uk ([80.176.88.36]) by lon1-post-1.mail.demon.net with esmtp (Exim 4.69) id 1RfE5F-0004w6-XG for binutils@sourceware.org; Mon, 26 Dec 2011 17:11:33 +0000 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by jsm-net.demon.co.uk (8.14.4/8.9.3) with ESMTP id pBQHBUK6024350 for ; Mon, 26 Dec 2011 17:11:30 GMT Subject: Duplicate 0x prefix - cr16 - bug. no. 10173 From: James Murray To: binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" Date: Mon, 26 Dec 2011 17:11:00 -0000 Message-ID: <1324919489.2430.89.camel@jsm2> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-12/txt/msg00304.txt.bz2 Regarding: http://sourceware.org/bugzilla/show_bug.cgi?id=10173 The fix for the duplicate 0x prefix on numbers during disassembly was: --- src/opcodes/cr16-dis.c 2008/11/27 11:30:33 1.5 +++ src/opcodes/cr16-dis.c 2009/06/15 15:24:52 1.6 @@ -678,7 +678,9 @@ + /* PR 10173: Avoid printing the 0x prefix twice. */ + if (info->num_symbols > 0) + func (stream, "%s", "0x"); I'm wondering if that might be better as + if (info->symtab_size > 0) Today I ran into a similar long-standing issue on the m68hc11 where the 0x prefixes were omitted on some addresses, or duplicated some times after I'd added the 0x to the target-specific code. objdump.c does this: (line 1030) if (sorted_symcount < 1) { but that's not always the same value as info->symtab_size, so when I tried applying the same fix as for cr16 I was still getting duplicated or omitted 0x. At the end of the function after sorted_symcount is manipulated, the value is stored (line 2213) disasm_info.symtab_size = sorted_symcount; So my change is supposed to then use that same value. So far in my testing, that appears to resolve the issue and allows the 0x to be emitted in either core or target code but not both. regards James Murray