This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] '0x' prefix on objdump addresses


Hi,

I've had a customer file a bug on this item, and on closer inspection it
appears that all objdump configurations fail to distinguish the printed
forms of different sorts of address operands which resolve near symbols;
eg. 15 (unsigned, hex) and 15 (signed, decimal). The hex ought to be
printed as 0x15, by customer's reckoning.

I talked to fche about this, and his impression was it ought to have
been fixed in objdump long ago (and it was fixed, back in 1997, for
symbols which are not resolved near addresses); is there a general
consensus about why it should/shouldn't happen for general addresses? 

The biggest problem I can forsee is the large-ish number of testsuites
this would trivially invalidate. The whole gas suite, at least, would
need adjusting. Any volunteers?

Here's the patch, at any rate.

-graydon

Index: objdump.c
===================================================================
RCS file: /cvs/src/src/binutils/objdump.c,v
retrieving revision 1.46
diff -u -r1.46 objdump.c
--- objdump.c   2001/12/18 08:22:30     1.46
+++ objdump.c   2002/01/10 20:01:05
@@ -797,6 +797,7 @@
      struct disassemble_info *info;
      boolean skip_zeroes;
 {
+  (*info->fprintf_func) (info->stream, "0x");
   objdump_print_value (vma, info, skip_zeroes);
 
   if (sym == NULL)




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]