Red Hat Bugzilla – Bug 208880
Pointless file(1) error message while detecting ELF 64-bit file
Last modified: 2013-07-02 19:17:29 EDT
Description of problem:
file(1) reports message "bad note name size 0x80000da4" while recognizing file
format of some ELF 64bit files.
Version-Release number of selected component (if applicable):
Run file(1) on the attached file.
Steps to Reproduce:
1. file 411toppm.debug
ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), bad note name size
0x80000da4, dynamically linked (uses shared libs), not stripped
ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), dynamically linked (uses
shared libs), not stripped
Created attachment 137546 [details]
File checks, if note name size is greater then 0x80000000 if it is, file
complains. Do you have idea where to check whether note name size can be of such
The file is the stripped-into-separate-file debuginfo, in which sections that
are present in the stripped file are made SHT_NOBITS and not present at all.
So, file needs to check for SHT_NOBITS .note sections and don't look at them
at all. Currently it just reads some completely unrelated data (probably
part of one of the .debug_* sections).
*** Bug 207918 has been marked as a duplicate of this bug. ***
Created attachment 138685 [details]
Proposed patch. While it would be possible to do what I proposed (i.e.
for each PT_NOTE look up in section header table in which section the virtual
address falls in and test if it is not SHT_NOBITS), this is far easier and
and has a nice side-effect that it doesn't duplication information in file
output. Unpatched file will e.g. say:
/bin/bash: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for
GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9,
(note the .note.ABI-tag section being parsed and printed twice, once when found
through PT_NOTE, once when found through SHT_NOTE). When the executable has
a section header table, then it is safe to assume that either there will be
a SHT_NOTE section corresponding to the PT_NOTE program header, or it will be
SHT_NOBITS in a debuginfo file (at which point it is not present).
Thanks for patch. I'm sorry for delay in resolving this issue. This problem
should be fixed in file-4.19-1.fc7.