summaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-05-11 15:48:13 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-05-11 15:48:13 +0000
commit92e2c672f0c47772e8f0b93444696441425dc45f (patch)
treef3d90547c5a7dfca2bf7eb9e4ebd12f075c75105 /binutils/readelf.c
parentc8f4db3137c73c932e34c919b1797e8d88b8d09b (diff)
downloadbinutils-redhat-92e2c672f0c47772e8f0b93444696441425dc45f.tar.gz
Always display addend as signed hex number
binutils/ PR binutils/14088 * readelf.c (dump_relocations): Always display addend as signed hex number. ld/testsuite/ PR binutils/14088 * ld-ia64/tlspic.rd: Updated. * ld-x86-64/tlsdesc-nacl.rd: Likewise. * ld-x86-64/tlsdesc.rd: Likewise. * ld-x86-64/tlspic-nacl.rd: Likewise. * ld-x86-64/tlspic.rd: Likewise.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 937cac18a8..84a13a741e 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -1387,9 +1387,13 @@ dump_relocations (FILE * file,
}
else if (is_rela)
{
- printf ("%*c", is_32bit_elf ?
- (do_wide ? 34 : 28) : (do_wide ? 26 : 20), ' ');
- print_vma (rels[i].r_addend, LONG_HEX);
+ bfd_signed_vma off = rels[i].r_addend;
+
+ printf ("%*c", is_32bit_elf ? 12 : 20, ' ');
+ if (off < 0)
+ printf ("-%" BFD_VMA_FMT "x", - off);
+ else
+ printf ("%" BFD_VMA_FMT "x", off);
}
if (elf_header.e_machine == EM_SPARCV9