Bug 15639

Summary: gold and -flto always fails with an internal error on arm-linux-gnueabi*
Product: binutils Reporter: Matthias Klose <doko>
Component: goldAssignee: Cary Coutant <ccoutant>
Status: RESOLVED FIXED    
Severity: normal CC: ccoutant, iamsergio
Priority: P2    
Version: 2.24   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Attachments: Refactors code so that target-specific versions of do_read_symbols aren't called twice.

Description Matthias Klose 2013-06-17 18:54:02 UTC
seen with gcc-4.7 and binutils 2.22, and 4.8 and binutils trunk,

$ echo "int main() {return 0;}" >a.c
$ gcc -fuse-ld=gold -flto a.c
/usr/bin/ld.gold: internal error in do_read_symbols, at ../../gold/arm.cc:6735
collect2: error: ld returned 1 exit status
Comment 1 Sérgio Martins 2014-01-22 00:56:54 UTC
Same on the latest gcc/binutils trunk.

Any hope here ?
Comment 2 Cary Coutant 2014-07-07 17:24:25 UTC
Created attachment 7682 [details]
Refactors code so that target-specific versions of do_read_symbols aren't called twice.
Comment 3 Sourceware Commits 2014-07-08 17:45:20 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  f35c4853cc5b0e51d8a460be390f7a20cd44ba44 (commit)
      from  b484180108158f427f3637987de02199416ed53a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

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

commit f35c4853cc5b0e51d8a460be390f7a20cd44ba44
Author: Cary Coutant <ccoutant@google.com>
Date:   Mon Jul 7 10:14:45 2014 -0700

    Fix internal error with LTO on ARM.
    
    This prevents the target-specific do_read_symbols methods from being called
    twice when do_layout_deferred_sections needs to layout an .eh_frame section.
    
    gold/
    	PR gold/15639
    	* dynobj.h (Sized_dynobj::base_read_symbols): New method.
    	* dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
    	(Sized_dynobj::base_read_symbols): ...new method.
    	* object.h (Sized_relobj_file::base_read_symbols): New method.
    	* object.cc (Sized_relobj_file::do_read_symbols): Move body to...
    	(Sized_relobj_file::base_read_symbols): ...new method.
    	* arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
    	* mips.cc: (Mips_relobj::do_read_symbols): Likewise.
    	* powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.

-----------------------------------------------------------------------

Summary of changes:
 gold/ChangeLog  |   13 +++++++++++++
 gold/arm.cc     |    4 ++--
 gold/dynobj.cc  |   11 +++++++++++
 gold/dynobj.h   |    6 ++++++
 gold/mips.cc    |    2 +-
 gold/object.cc  |   12 +++++++++++-
 gold/object.h   |    5 +++++
 gold/powerpc.cc |    6 +++---
 8 files changed, 52 insertions(+), 7 deletions(-)
Comment 4 Cary Coutant 2014-07-08 17:48:29 UTC
Fixed on trunk.