summaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2008-03-13 05:27:42 +0000
committerAlan Modra <amodra@bigpond.net.au>2008-03-13 05:27:42 +0000
commiteeeecfe417c55a54a25ef82121860258de7ddb81 (patch)
treec3b55292827cc86945abd40ae2d5ac5949473313 /binutils/readelf.c
parent338a8dd0fa66410b3bc4a0ab1e1a49a166e6897b (diff)
downloadbinutils-redhat-eeeecfe417c55a54a25ef82121860258de7ddb81.tar.gz
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/readelf.c')
-rw-r--r--binutils/readelf.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index ae13b3ebc1..e9c380ff3a 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));