Bug 41782 - lto/gold: -flto -user-linker-plugin dies with internal error in gold
Summary: lto/gold: -flto -user-linker-plugin dies with internal error in gold
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: lto
Depends on:
Blocks:
 
Reported: 2009-10-21 11:21 UTC by Török Edwin
Modified: 2011-01-08 19:44 UTC (History)
5 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
testcase (reduced not.i) (831 bytes, text/plain)
2009-10-21 11:22 UTC, Török Edwin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Török Edwin 2009-10-21 11:21:33 UTC
When trying to compile and link the attached not.i with lto the linker dies with this error:
/usr/bin/ld: internal error in set_linkonce_size, at ../../gold/layout.h:250

This only occurs if I use -use-linker-plugin, so I think this may be a bug in gcc's gold plugin, so I'm filing this as a gcc  bug (but it may also be a bug in gold triggered by lto).

To reproduce:
$ /home/edwin/inst/bin/g++ -flto -c not.i -o not.o
$ /home/edwin/inst/bin/g++  -shared -flto -use-linker-plugin    not.o
/usr/bin/ld: internal error in set_linkonce_size, at ../../gold/layout.h:250
collect2: ld returned 1 exit status

$ /home/edwin/inst/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/home/edwin/inst/bin/g++
COLLECT_LTO_WRAPPER=/home/edwin/inst/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure --enable-lto --enable-languages=c,c++ --enable-gold : (reconfigured) ../gcc/configure --enable-lto --enable-languages=c,c++ --enable-gold
Thread model: posix
gcc version 4.5.0 20091020 (experimental) (GCC)

$ ld -v
GNU gold (GNU Binutils for Debian 2.20) 1.9
Comment 1 Török Edwin 2009-10-21 11:22:01 UTC
Created attachment 18855 [details]
testcase (reduced not.i)
Comment 2 Jan Hubicka 2011-01-08 19:44:30 UTC
Works for me 

evans:/abuild/jh/trunk-3/build-inst2/gcc/:[0]# /abuild/jh/trunk-install/bin/ld --version
GNU gold (GNU Binutils; SUSE Linux Enterprise 11 2.20.0.20100122-0.7.9) 1.9
Copyright 2008 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
evans:/abuild/jh/trunk-3/build-inst2/gcc/:[0]# /abuild/jh/trunk-install/bin/g++ --version                                                   
g++ (GCC) 4.6.0 20110108 (experimental)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

So I guess the problem is fixed at 4.6 branch - there was a lot of improvments for plugin symtabs there.