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.
This commit is contained in:
parent
50e7d84b42
commit
72de500931
7 changed files with 51 additions and 37 deletions
|
@ -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));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue