Allow readelf to issue warnings if checking is enabled and there are discrepancies...
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 19 May 2020 15:47:12 +0000 (16:47 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 19 May 2020 15:47:12 +0000 (16:47 +0100)
commit8ac10c5bfca0602398b38cc69976db213a7d9917
tree7138bc1ff4533ed7299dc72e4be2e91639fc19f3
parent7e94cf6cb018df7cc1311afb2b15e9f69adb60d9
Allow readelf to issue warnings if checking is enabled and there are discrepancies between the dynamic tags and the dynamic sections.

PR binutils/25809
* readelf.c (process_program_headers): Warn if the PT_DYNAMIC
segment doesn't match the .dynamic section and checks are
enabled.
(struct filedata): Add dynamic_symtab_section and
dynamic_strtab_section fields.
(process_section_headers): Set dynamic_symtab_section to the
.dynsym section.  Set dynamic_strtab_section to the .dynstr
section.
(process_dynamic_section): Warn if the .dynsym section doesn't
match DT_SYMTAB and DT_SYMENT or the .dynstr section doesn't
DT_STRTAB and DT_STRSZ.  But only if checks are enabled.
binutils/ChangeLog
binutils/readelf.c