From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2) Gecko/20040301 Description of problem: readelf divides by zero when Elf32_Shdr.sh_entsize is 0 for a .symtab section; the result is termination by Floating point exception. Yes, such input is malformed. However, a diagnostic program such as readelf should check for such things and give a good error message. Aborting due to signal is poor practice. Version-Release number of selected component (if applicable): binutils-2.15.90.0.3-5 How reproducible: Always Steps to Reproduce: 1. Take a known-good ET_REL file with a symbol table, binary edit the .sh_entsize for the .symtab section to be 0, and run "readelf --symbols" on the file. 2. 3. Actual Results: Floating point exception (SIGFPE) Expected Results: A nice diagnostic such as: readelf: 0==.sh_entsize for .symtab (section NN) and then acting as if 1==.sh_entsize (no floating point exception). Additional info: binutils/readelf.c: 5764 printf (_("\nSymbol table '%s' contains %lu entries:\n"), 5765 SECTION_NAME (section), 5766 (unsigned long) (section->sh_size / section->sh_entsize));
There are many places, not just one, in more than one tool that rely that some fields aren't really bogus. If you want this changed, submit patches upstream, I don't think this is severe enough to require working on it.