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


>> 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.

We would need to replicate the linker's archive search behavior.
Probably the best way to implement this would be to run the trial link
with the -t option and have collect2 parse the output and extract just
those members that were loaded during the trial link.

>>        * collect2.c (is_elf): New function.
>>        (scan_prog_file): Require LTO object to be in ELF format.
>
> OK.

Committed.

-cary


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