From e04d7088afe0be6ef89900a994bd48bf35d17e77 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 11 May 2012 15:48:15 +0000 Subject: 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. --- binutils/ChangeLog | 6 ++++++ binutils/readelf.c | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'binutils') diff --git a/binutils/ChangeLog b/binutils/ChangeLog index f620fe0..3a5c740 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2012-05-11 H.J. Lu + + PR binutils/14088 + * readelf.c (dump_relocations): Always display addend as + signed hex number. + 2012-05-11 Daniel Richard G. PR binutils/14028 diff --git a/binutils/readelf.c b/binutils/readelf.c index 937cac1..84a13a7 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 -- cgit v1.1