Bug 19060 - could not decompress section .debug_str
Summary: could not decompress section .debug_str
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.26
: P2 normal
Target Milestone: 2.26
Assignee: Cary Coutant
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-03 12:53 UTC by Markus Trippelsdorf
Modified: 2015-10-04 13:17 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
object file (6.67 KB, application/x-object)
2015-10-03 12:53 UTC, Markus Trippelsdorf
Details
reduced testcase (must be used in the correct directory) (1.95 KB, text/plain)
2015-10-03 12:54 UTC, Markus Trippelsdorf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Trippelsdorf 2015-10-03 12:53:13 UTC
Created attachment 8677 [details]
object file

Building perf fails with gold:

markus@x4 perf % pwd
/usr/src/linux/tools/perf
markus@x4 perf % gcc -c annotate.i -O2 -g3
line-map.c: file "/usr/include/glib-2.0/gio/gbufferedinputstream.h" left but not entered
line-map.c: file "/usr/include/glib-2.0/gio/gfilteroutputstream.h" left but not entered
line-map.c: file "/usr/include/glib-2.0/gio/gcharsetconverter.h" left but not entered
markus@x4 perf % ld -r -o /dev/null annotate.o
ld: error: annotate.o: could not decompress section .debug_str

ld.bfd is fine.

I have tried to reduce the testcase, but the failure then depends
on the directory in which gcc is invoked.
Comment 1 Markus Trippelsdorf 2015-10-03 12:54:24 UTC
Created attachment 8678 [details]
reduced testcase (must be used in the correct directory)
Comment 2 cvs-commit@gcc.gnu.org 2015-10-04 13:15:59 UTC
The master branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9706b5e627dfae1ab0a2788dda8a2aa5a0e09af7

commit 9706b5e627dfae1ab0a2788dda8a2aa5a0e09af7
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Oct 4 06:14:13 2015 -0700

    Change ch_type to Elf_Word in struct Chdr_data<64>
    
    The ch_type field in struct Chdr_data<64>  is 4 bytes, followed by a
    4-byte padding.  This change doesn't introduce any functional change
    since only the lower 32 bits of the ch_type field are used.
    
    	PR gold/19060
    	* elfcpp.h (Chdr::get_ch_type): Change return type to Elf_Word.
    	* elfcpp_internal.h (Chdr_data<64>): Change ch_type to 4 bytes
    	and add ch_reserved.
Comment 3 H.J. Lu 2015-10-04 13:17:39 UTC
Fixed.