Bug 13227 - GCC now produce slim LTO files. Those can't be linked/archived or nm w/o plugin used. It would be useful to output diagnostics when user attempts so
Summary: GCC now produce slim LTO files. Those can't be linked/archived or nm w/o plu...
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Alan Modra
URL:
Keywords:
: 15300 (view as bug list)
Depends on: 14698
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-27 17:34 UTC by Jan Hubicka
Modified: 2014-08-06 03:11 UTC (History)
2 users (show)

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


Attachments
gold patch (491 bytes, patch)
2014-07-29 10:28 UTC, Alan Modra
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Hubicka 2011-09-27 17:34:34 UTC
The symbols are now marked as
jh@gcc10:~/trunk/build4/gcc$ nm t.o
0000000000000001 C __gnu_lto_v1
0000000000000001 C __gnu_slim_lto

When those symbols are present, it would be very useful if nm/ar/ld output warning explaning that plugin needs to be used.

Honza
Comment 1 Richard Biener 2014-03-20 14:02:27 UTC
See 14698.
Comment 2 hubicka 2014-04-03 16:18:49 UTC
> Bug 14698 Summary: ar, nm and ranlib don't use gcc's liblto_plugin.so in BINDIR/../lib/bfd-plugins automatically
> https://sourceware.org/bugzilla/show_bug.cgi?id=14698

Will we now get some sort of warning/error when the LTO objects are used but plugin is not found in
the search path?

Honza
Comment 3 rguenther 2014-04-04 07:52:40 UTC
On Thu, 3 Apr 2014, hubicka at ucw dot cz wrote:

> https://sourceware.org/bugzilla/show_bug.cgi?id=13227
> 
> --- Comment #2 from hubicka at ucw dot cz ---
> > Bug 14698 Summary: ar, nm and ranlib don't use gcc's liblto_plugin.so in BINDIR/../lib/bfd-plugins automatically
> > https://sourceware.org/bugzilla/show_bug.cgi?id=14698
> 
> Will we now get some sort of warning/error when the LTO objects are used but
> plugin is not found in
> the search path?

No, bfd relies on the plugin to detect LTO objects thus if there is no
plugin then it won't know it's an LTO object
Comment 4 Alan Modra 2014-07-28 04:23:31 UTC
*** Bug 15300 has been marked as a duplicate of this bug. ***
Comment 5 Alan Modra 2014-07-28 04:27:02 UTC
So is it sufficient (and safe) to warn just on the presence of __gnu_slim_lto?
Comment 6 Richard Biener 2014-07-28 07:49:16 UTC
(In reply to Alan Modra from comment #5)
> So is it sufficient (and safe) to warn just on the presence of
> __gnu_slim_lto?

Yes, I think so.
Comment 7 hubicka 2014-07-28 08:33:23 UTC
> So is it sufficient (and safe) to warn just on the presence of __gnu_slim_lto?

Yes, when __gnu_slim_lto gets into linking/archiving/nm, I think it is safe to warn about
missing plugin.

Honza
Comment 8 Sourceware Commits 2014-07-28 13:11:04 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  b794fc1d1c3a3dfb65b74a36fe96c474fee65000 (commit)
      from  774bb79e9b9e192bcecc38da919edffaf9b5d236 (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=b794fc1d1c3a3dfb65b74a36fe96c474fee65000

commit b794fc1d1c3a3dfb65b74a36fe96c474fee65000
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Jul 28 22:18:25 2014 +0930

    Warn for ar/nm/ranlib/ld on lto objects without plugin
    
    	PR 13227
    bfd/
    	* archive.c (_bfd_compute_and_write_armap): Warn on adding
    	__gnu_lto_slim to armap.
    	* linker.c (_bfd_generic_link_add_one_symbol): Warn on adding
    	__gnu_lto_slim to linker hash table.
    binutils/
    	* nm.c (filter_symbols): Warn on __gnu_lto_slim.

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

Summary of changes:
 bfd/ChangeLog      |    8 ++++++++
 bfd/archive.c      |    4 ++++
 bfd/linker.c       |    8 +++++++-
 binutils/ChangeLog |    5 +++++
 binutils/nm.c      |    4 ++++
 5 files changed, 28 insertions(+), 1 deletions(-)
Comment 9 Alan Modra 2014-07-28 13:11:36 UTC
Fixed
Comment 10 hubicka 2014-07-29 09:44:54 UTC
> Fixed
Thanks, does this also cover gold linker?

Honza
Comment 11 Alan Modra 2014-07-29 10:18:14 UTC
No, I didn't do anything about gold.
Comment 12 Alan Modra 2014-07-29 10:28:22 UTC
Created attachment 7730 [details]
gold patch

This should fix gold
Comment 13 Sourceware Commits 2014-08-06 03:11:39 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  7cd4e5b756fa5c1ebe0ba7dd04e45d46330a7675 (commit)
      from  8e07a239c12ba3b746ef0cf2c53d572315aef654 (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=7cd4e5b756fa5c1ebe0ba7dd04e45d46330a7675

commit 7cd4e5b756fa5c1ebe0ba7dd04e45d46330a7675
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Aug 6 12:40:00 2014 +0930

    Warn for gold on lto objects without plugin
    
    	PR 13227
    	* symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.

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

Summary of changes:
 gold/ChangeLog |    5 +++++
 gold/symtab.cc |    4 ++++
 2 files changed, 9 insertions(+), 0 deletions(-)