From 20414cabefd9bfe3398e58193f59118b295904bf Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 5 Jan 2007 01:25:06 +0000 Subject: [PATCH] * readelf.c (dump_section): Don't print 32-bit values, which were done incorrectly for little-endian. Instead print bytes. --- binutils/ChangeLog | 5 +++++ binutils/readelf.c | 33 +++++++-------------------------- 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 9961063afd..d63cbc2b84 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2007-01-05 Alan Modra + + * readelf.c (dump_section): Don't print 32-bit values, which + were done incorrectly for little-endian. Instead print bytes. + 2006-12-25 Kazu Hirata * readelf.c (get_machine_flags): Handle EF_M68K_CPU32_FIDO_A. diff --git a/binutils/readelf.c b/binutils/readelf.c index 592d8935dc..2aa6ef0e2f 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -7671,34 +7671,15 @@ dump_section (Elf_Internal_Shdr *section, FILE *file) printf (" 0x%8.8lx ", (unsigned long) addr); - switch (elf_header.e_ident[EI_DATA]) + for (j = 0; j < 16; j++) { - default: - case ELFDATA2LSB: - for (j = 15; j >= 0; j --) - { - if (j < lbytes) - printf ("%2.2x", data[j]); - else - printf (" "); + if (j < lbytes) + printf ("%2.2x", data[j]); + else + printf (" "); - if (!(j & 0x3)) - printf (" "); - } - break; - - case ELFDATA2MSB: - for (j = 0; j < 16; j++) - { - if (j < lbytes) - printf ("%2.2x", data[j]); - else - printf (" "); - - if ((j & 3) == 3) - printf (" "); - } - break; + if ((j & 3) == 3) + printf (" "); } for (j = 0; j < lbytes; j++)