aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2008-03-13 05:27:42 +0000
committerAlan Modra <amodra@gmail.com>2008-03-13 05:27:42 +0000
commit72de5009312d26000c098d9876e30e631b80fc95 (patch)
treeaff9c10337b37eb71ad84154d74fa52de54276eb /binutils
parent50e7d84b42f09c20d29ce502157edded74e71778 (diff)
downloadgdb-72de5009312d26000c098d9876e30e631b80fc95.zip
gdb-72de5009312d26000c098d9876e30e631b80fc95.tar.gz
gdb-72de5009312d26000c098d9876e30e631b80fc95.tar.bz2
include/elf/
* internal.h (Elf_Internal_Shdr): Change sh_link and sh_info from unsigned long to unsigned int. Change sh_addralign to bfd_vma. Order struct as for external version. bfd/ * elf.c (_bfd_elf_make_section_from_shdr): Remove unnecessary cast. (_bfd_elf_assign_file_position_for_section): Simplify align. (_bfd_elf_init_reloc_shdr): Ensure shift expression wide enough for sh_addralign. (elf_fake_sections, swap_out_syms): Likewise. * elflink.c (bfd_elf_final_link): Likewise. binutils/ * readelf.c: Use %u throughout when printing sh_link or sh_info, %lu when printing sh_addralign. (process_version_sections): Use identical formats when printing all offset and sh_link fields.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog7
-rw-r--r--binutils/readelf.c36
2 files changed, 24 insertions, 19 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 3792a11..1f311d9 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,12 @@
2008-03-13 Alan Modra <amodra@bigpond.net.au>
+ * readelf.c: Use %u throughout when printing sh_link or sh_info,
+ %lu when printing sh_addralign.
+ (process_version_sections): Use identical formats when printing
+ all offset and sh_link fields.
+
+2008-03-13 Alan Modra <amodra@bigpond.net.au>
+
* Makefile.am: Run "make dep-am".
* Makefile.in: Regenerate.
* doc/Makefile.in: Regenerate.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index ae13b3e..e9c380f 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -3340,7 +3340,7 @@ process_file_header (void)
(long) elf_header.e_shstrndx);
if (section_headers != NULL
&& elf_header.e_shstrndx == (SHN_XINDEX & 0xffff))
- printf (" (%ld)", (long) section_headers[0].sh_link);
+ printf (" (%u)", section_headers[0].sh_link);
else if (elf_header.e_shstrndx >= elf_header.e_shnum)
printf (" <corrupt: out of range>");
putc ('\n', stdout);
@@ -4413,9 +4413,9 @@ process_section_headers (FILE *file)
else
printf (" %3s ", get_elf_section_flags (section->sh_flags));
- printf ("%2ld %3lu %2ld\n",
- (unsigned long) section->sh_link,
- (unsigned long) section->sh_info,
+ printf ("%2u %3u %2lu\n",
+ section->sh_link,
+ section->sh_info,
(unsigned long) section->sh_addralign);
}
else if (do_wide)
@@ -4451,12 +4451,10 @@ process_section_headers (FILE *file)
else
printf (" %3s ", get_elf_section_flags (section->sh_flags));
- printf ("%2ld %3lu ",
- (unsigned long) section->sh_link,
- (unsigned long) section->sh_info);
+ printf ("%2u %3u ", section->sh_link, section->sh_info);
if ((unsigned long) section->sh_addralign == section->sh_addralign)
- printf ("%2ld\n", (unsigned long) section->sh_addralign);
+ printf ("%2lu\n", (unsigned long) section->sh_addralign);
else
{
print_vma (section->sh_addralign, DEC);
@@ -4475,13 +4473,13 @@ process_section_headers (FILE *file)
printf (" ");
print_vma (section->sh_offset, LONG_HEX);
}
- printf (" %ld\n ", (unsigned long) section->sh_link);
+ printf (" %u\n ", section->sh_link);
print_vma (section->sh_size, LONG_HEX);
putchar (' ');
print_vma (section->sh_entsize, LONG_HEX);
- printf (" %-16lu %ld\n",
- (unsigned long) section->sh_info,
+ printf (" %-16u %lu\n",
+ section->sh_info,
(unsigned long) section->sh_addralign);
}
else
@@ -4502,9 +4500,9 @@ process_section_headers (FILE *file)
printf (" %3s ", get_elf_section_flags (section->sh_flags));
- printf (" %2ld %3lu %ld\n",
- (unsigned long) section->sh_link,
- (unsigned long) section->sh_info,
+ printf (" %2u %3u %lu\n",
+ section->sh_link,
+ section->sh_info,
(unsigned long) section->sh_addralign);
}
@@ -6559,12 +6557,12 @@ process_version_sections (FILE *file)
found = 1;
printf
- (_("\nVersion definition section '%s' contains %ld entries:\n"),
+ (_("\nVersion definition section '%s' contains %u entries:\n"),
SECTION_NAME (section), section->sh_info);
printf (_(" Addr: 0x"));
printf_vma (section->sh_addr);
- printf (_(" Offset: %#08lx Link: %lx (%s)\n"),
+ printf (_(" Offset: %#08lx Link: %u (%s)\n"),
(unsigned long) section->sh_offset, section->sh_link,
section->sh_link < elf_header.e_shnum
? SECTION_NAME (section_headers + section->sh_link)
@@ -6661,12 +6659,12 @@ process_version_sections (FILE *file)
found = 1;
- printf (_("\nVersion needs section '%s' contains %ld entries:\n"),
+ printf (_("\nVersion needs section '%s' contains %u entries:\n"),
SECTION_NAME (section), section->sh_info);
printf (_(" Addr: 0x"));
printf_vma (section->sh_addr);
- printf (_(" Offset: %#08lx Link to section: %ld (%s)\n"),
+ printf (_(" Offset: %#08lx Link: %u (%s)\n"),
(unsigned long) section->sh_offset, section->sh_link,
section->sh_link < elf_header.e_shnum
? SECTION_NAME (section_headers + section->sh_link)
@@ -6787,7 +6785,7 @@ process_version_sections (FILE *file)
printf (_(" Addr: "));
printf_vma (section->sh_addr);
- printf (_(" Offset: %#08lx Link: %lx (%s)\n"),
+ printf (_(" Offset: %#08lx Link: %u (%s)\n"),
(unsigned long) section->sh_offset, section->sh_link,
SECTION_NAME (link_section));