From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031018 Description of problem: When running file on a ELF format file with no section header, file produces a bogus warning. A sample session: $ file epsxe epsxe: ELF 32-bit LSB executable, Intel 80386, version 1 (Linux), statically linkedfile: corrupted section header size. The code responsible for the corrupted section header size. is added by the file-3.39-cksize.patch patch. In the functions doshn, dophn_exec, and dophn_core, the following checks are made: doshn: if (size != sh_size) error("corrupted section header size.\n"); dophn_exec: dophn_core: if (size != ph_size) error("corrupted program header size.\n"); sh_size and ph_size are the sizes of the ELF headers and size is the size of the header being looked up. But, size can be zero if there is no section or program header. If a program has now section header, a incorrect error is returned. See ELF Header A simple fix is to check if num or size are zero and return if they are. A patch is attached to fix the problem. Version-Release number of selected component (if applicable): file-3.39-9 How reproducible: Always Steps to Reproduce: 1. Run upx on a ELF executable 2. Run file on the resulting file 3. Actual Results: I got a line saying epsxe: ELF 32-bit LSB executable, Intel 80386, version 1 (Linux), statically linkedfile: corrupted section header size. Expected Results: It should only say epsxe: ELF 32-bit LSB executable, Intel 80386, version 1 (Linux), statically linked Additional info: If file doesn't like the executable, then its use in brp-strip prevents the creation of RPMS
Created attachment 95833 [details] Check variable num and return if it's zero
Fixed in file-4.10-1. File reports "no section header"