aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/objdump.c22
2 files changed, 23 insertions, 4 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 3d2e066..7072d1e 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ * objdump.c (disassemble_bytes): Print addend as signed.
+ (dump_reloc_set): Likewise.
+
2012-05-04 Sterling Augustine <saugustine@google.com>
Cary Coutant <ccoutant@google.com>
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 0cad73b..b22bf8b 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -1840,8 +1840,15 @@ disassemble_bytes (struct disassemble_info * inf,
if (q->addend)
{
- printf ("+0x");
- objdump_print_value (q->addend, inf, TRUE);
+ bfd_signed_vma addend = q->addend;
+ if (addend < 0)
+ {
+ printf ("-0x");
+ addend = -addend;
+ }
+ else
+ printf ("+0x");
+ objdump_print_value (addend, inf, TRUE);
}
printf ("\n");
@@ -3017,8 +3024,15 @@ dump_reloc_set (bfd *abfd, asection *sec, arelent **relpp, long relcount)
if (q->addend)
{
- printf ("+0x");
- bfd_printf_vma (abfd, q->addend);
+ bfd_signed_vma addend = q->addend;
+ if (addend < 0)
+ {
+ printf ("-0x");
+ addend = -addend;
+ }
+ else
+ printf ("+0x");
+ bfd_printf_vma (abfd, addend);
}
if (addend2)
{