This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [lto][patch] Temporary fix for undefined symbols when linking with archives containing LTO objects


On Wed, Nov 26, 2008 at 19:02, Cary Coutant <ccoutant@google.com> 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  <ccoutant@google.com>
>
>        * collect2.c (is_elf): New function.
>        (scan_prog_file): Require LTO object to be in ELF format.

OK.


Diego.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]