diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2012-05-14 02:40:00 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2012-05-14 02:40:00 +0000 |
commit | 343dbc36ffaeb831073fbc64101a16f63e4daca8 (patch) | |
tree | 8e5ba9f06e98317ae12f0fd48debb01962023f41 /binutils/objdump.c | |
parent | c772f8e7339f4e0c8b8a5ed10d71848002c2ac18 (diff) | |
download | gdb-343dbc36ffaeb831073fbc64101a16f63e4daca8.zip gdb-343dbc36ffaeb831073fbc64101a16f63e4daca8.tar.gz gdb-343dbc36ffaeb831073fbc64101a16f63e4daca8.tar.bz2 |
Print addend as signed in objdump
binutils/
* objdump.c (disassemble_bytes): Print addend as signed.
(dump_reloc_set): Likewise.
gas/testsuite/
* gas/all/fwdexp.d: Expect addend as signed.
* gas/alpha/elf-reloc-1.d: Likewise.
* gas/i386/mixed-mode-reloc64.d: Likewise.
* gas/i386/reloc64.d: Likewise.
* gas/i386/ilp32/mixed-mode-reloc64.d: Expect addend as signed.
* gas/i386/ilp32/reloc64.d: Likewise.
* gas/ia64/pcrel.d: Likewise.
* gas/mips/branch-misc-2-64.d: Likewise.
* gas/mips/branch-misc-2pic-64.d: Likewise.
* gas/mips/branch-misc-4-64.d: Likewise.
* gas/mips/ldstla-n64-sym32.d: Likewise.
* gas/mips/micromips@branch-misc-2-64.d: Likewise.
* gas/mips/micromips@branch-misc-2pic-64.d: Likewise.
* gas/mips/micromips@branch-misc-4-64.d: Likewise.
* gas/mips/mips16-hilo-n32.d: Likewise.
* gas/ppc/astest.d: Likewise.
* gas/ppc/astest2.d: Likewise.
* gas/ppc/astest2_64.d: Likewise.
* gas/ppc/astest64.d: Likewise.
* gas/ppc/test1elf32.d: Likewise.
* gas/ppc/test1elf64.d: Likewise.
* gas/sparc/reloc64.d: Likewise.
Diffstat (limited to 'binutils/objdump.c')
-rw-r--r-- | binutils/objdump.c | 22 |
1 files changed, 18 insertions, 4 deletions
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) { |