PATCH: PR binutils/6412: New binutils is incompatible with old object files
Sat Apr 19 01:17:00 GMT 2008
This is the patch for readelf to handle old object files. It checks if
one of sh_link in section header table >= number of sections. It
works on object files generated by GNU assembler and linker
since they put the .strtab section at the end of section header
I will use the similar approach in bfd. I think gold should also
support old object files.
2008-04-18 H.J. Lu <firstname.lastname@example.org>
* readelf.c (hole_in_shndx): New.
(process_file_header): Move ELF magic bytes check to ...
(get_32bit_section_headers): Set hole_in_shndx if sh_link
>= number of sections.
(get_32bit_elf_symbols): Adjust st_shndx if hole_in_shndx
(process_section_headers): Adjust elf_header.e_shstrndx,
sh_link and sh_info, save original sh_link and sh_info,
display adjustment for sh_link and sh_info if hole_in_shndx
(process_section_groups): Adjust member section index if
hole_in_shndx isn't 0.
(process_object): Free original_shndx if needed.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the Binutils