Summary: | bad handling of .debug_str_offsets section | ||
---|---|---|---|
Product: | binutils | Reporter: | dje |
Component: | binutils | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | hjl.tools |
Priority: | P2 | ||
Version: | 2.26 | ||
Target Milestone: | 2.26 | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: |
testcase
testcase #2, .c file testcase #2, .s file testcase #2, .dwo file A patch |
Description
dje
2015-04-08 20:10:50 UTC
Created attachment 8230 [details]
testcase
Please provide readelf-str-offsets.dwo. Bleah. I needed to make .debug_str_offsets.dwo larger so that it actually would get compressed. gcc -m64 -gdwarf-4 -gsplit-dwarf -c readelf-str-offsets-bug.c -Wa,--compress-debug-sections --save-temps < edit readelf-str-offsets-bug.s and move .debug_str_offsets.dwo ahead of .debug_info. This might no longer be necessary, but it's useful to exercise the original bug. > gcc -m64 -gdwarf-4 -gsplit-dwarf -c readelf-str-offsets-bug.s -Wa,--compress-debug-sections readelf -w readelf-str-offsets-bug.dwo Created attachment 8231 [details]
testcase #2, .c file
Created attachment 8232 [details]
testcase #2, .s file
Created attachment 8233 [details]
testcase #2, .dwo file
testcase uploaded Created attachment 8234 [details]
A patch
This works on the testcase. But it may not be correct.
A patch is posted at https://sourceware.org/ml/binutils/2015-04/msg00155.html The master branch has been updated by Doug Evans <devans@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0d2a7a932244fab27d6c4ce211ea8f7708a1a9cc commit 0d2a7a932244fab27d6c4ce211ea8f7708a1a9cc Author: Doug Evans <dje@google.com> Date: Mon Apr 13 12:50:17 2015 -0700 Fix reading of .debug_str_offsets{,.dwo} twice. PR binutils/18218 * readelf.c (printable_section_name): Constify sec argument. (apply_relocations): Ditto. New arg "size". All callers updated. (load_specific_debug_section): Constify sec argument. Remove side-effect of modifying sec->sh_size. Fix committed. |