This is the mail archive of the
mailing list for the GCC project.
Re: [lto][patch] Temporary fix for undefined symbols when linking with archives containing LTO objects
- From: Diego Novillo <dnovillo at google dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 26 Nov 2008 20:02:46 -0500
- Subject: Re: [lto][patch] Temporary fix for undefined symbols when linking with archives containing LTO objects
- References: <email@example.com>
On Wed, Nov 26, 2008 at 19:02, Cary Coutant <firstname.lastname@example.org> wrote:
> Collect2 is scanning all the input files with nm, which scans archives
> as well as regular objects. For any archive libraries that do contain
> LTO symbols, collect2 counts them as LTO files and passes them to WPA,
> then *leaves them out* of the final link (assuming that WPA has
> replaced them with real .o files). I've added a quick check in
> scan_prog_file to make sure that the file is ELF before counting it as
> an LTO object.
Oops. Good catch.
> A more ambitious fix would be to unpack the archive and send the
> member .o files to WPA, but that can come later if we deem it
> necessary for collect2 to handle that case. As I understand it, it was
> a deliberate decision to restrict collect2 to regular objects,
> assuming that the linker plugin will take care of it eventually.
Agreed. The other option is to make WPA understand .a files, though
it may be easier to unpack them beforehand.
> 2008-11-26 Cary Coutant <email@example.com>
> * collect2.c (is_elf): New function.
> (scan_prog_file): Require LTO object to be in ELF format.