Summary: | [2.29 Regression] readelf now exits with error reading an empty section | ||
---|---|---|---|
Product: | binutils | Reporter: | Michael Hudson-Doyle <michael.hudson> |
Component: | binutils | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | doko, mattia, michael.hudson, nickc, nickc |
Priority: | P2 | ||
Version: | 2.29 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: | the file from the diffoscope test suite that exhibits the problem |
Description
Michael Hudson-Doyle
2017-07-24 00:58:53 UTC
Created attachment 10284 [details]
the file from the diffoscope test suite that exhibits the problem
Here's the file I mentioned in the summary.
I also noticed that readelf -x exits with code 0 for a section that does not exist at all so exiting with code 1 for a present, empty section seems even more likely to be a bug.
The master branch has been updated by Nick Clifton <nickc@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c6b78c965a96fb152fbd58926edccb5dee2707a5 commit c6b78c965a96fb152fbd58926edccb5dee2707a5 Author: Nick Clifton <nickc@redhat.com> Date: Tue Jul 25 09:35:36 2017 +0100 Stop readelf from returning an error status if asked to dump an emoty section. PR 21820 * readelf.c (dump_section_as_strings): Do not fail if the section was empty. (dump_section_as_bytes): Likewise. Hi Michael, Thanks for reporting this problem. I guess it could be argued that if the section is empty, why is the user trying to dump it ? But I do not see this as a big issue, so I have gone ahead and applied a patch to restore the old behaviour of reporting, but not complaining about, empty sections. Cheers Nick The binutils-2_29-branch branch has been updated by Nick Clifton <nickc@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=64aa1246572306b72dc479b46d13ff749b0c3236 commit 64aa1246572306b72dc479b46d13ff749b0c3236 Author: Nick Clifton <nickc@redhat.com> Date: Tue Sep 5 15:32:04 2017 +0100 Import patches from mainline to fix minor binutils bugs: PR 21861 * winduni.c (codepages): Use cp1252 for codepage 0. PR 21813 * rddbg.c (read_symbol_stabs_debugging_info): Check for an empty string whilst concatenating symbol names. PR 21909 * prdbg.c (pr_int_type): Increase size of local string buffer. (pr_float_type): Likewise. (pr_bool_type): Likewise. PR 21820 * readelf.c (dump_section_as_strings): Do not fail if the section was empty. (dump_section_as_bytes): Likewise. PR 21990 * readelf.c (process_version_sections <SHT_GNU_verneed>): Check for invalid vn_next field before adding to idx. Use unsigned long for index vars. Move index checks. <SHT_GNU_verdef>: Likewise for vd_next. PR 21994 * readelf.c (process_version_sections <SHT_GNU_verdef>): Check vd_aux and vda_next for sanity. Delete "end". Correct overflow checks. (process_version_sections <SHT_GNU_verneed>): Correct overflow check. Don't report invalid vna_next on overflow. Do report invalid vna_next on size less than aux info. |