summaryrefslogtreecommitdiff
path: root/opcodes/avr-dis.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-04-12 13:09:10 +0000
committerNick Clifton <nickc@redhat.com>2006-04-12 13:09:10 +0000
commit0deab031b1b8ea6ed85b6946ceb4b962b250a5bb (patch)
tree28680cd37b24ab001a1a0d12191647c26c8bfae9 /opcodes/avr-dis.c
parenteecb31697c707f6f5e2f800765bf9e45cb7742c9 (diff)
downloadbinutils-redhat-0deab031b1b8ea6ed85b6946ceb4b962b250a5bb.tar.gz
PR binutils/2454
* avr-dis.c (avr_operand): Arrange for a comment to appear before the symolic form of an address, so that the output of objdump -d can be reassembled.
Diffstat (limited to 'opcodes/avr-dis.c')
-rw-r--r--opcodes/avr-dis.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/opcodes/avr-dis.c b/opcodes/avr-dis.c
index 1530084418..7938dcadba 100644
--- a/opcodes/avr-dis.c
+++ b/opcodes/avr-dis.c
@@ -139,7 +139,12 @@ avr_operand (unsigned int insn, unsigned int insn2, unsigned int pc, int constra
case 'h':
*sym = 1;
*sym_addr = ((((insn & 1) | ((insn & 0x1f0) >> 3)) << 16) | insn2) * 2;
- sprintf (buf, "0x");
+ /* See PR binutils/2545. Ideally we would like to display the hex
+ value of the address only once, but this would mean recoding
+ objdump_print_address() which would affect many targets. */
+ sprintf (buf, "%#lx", * sym_addr);
+ sprintf (comment, "0x");
+
break;
case 'L':