This is the mail archive of the
mailing list for the binutils project.
Duplicate 0x prefix - cr16 - bug. no. 10173
- From: James Murray <jsm at jsm-net dot demon dot co dot uk>
- To: binutils at sourceware dot org
- Date: Mon, 26 Dec 2011 17:11:29 +0000
- Subject: Duplicate 0x prefix - cr16 - bug. no. 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.