This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: 2 stage BFD linker for LTO plugin
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Dave Korn <dave dot korn dot cygwin at gmail dot com>
- Cc: Cary Coutant <ccoutant at google dot com>, Ian Lance Taylor <iant at google dot com>, GCC Development <gcc at gcc dot gnu dot org>, Binutils <binutils at sourceware dot org>
- Date: Sat, 4 Dec 2010 09:34:31 -0800
- Subject: Re: PATCH: 2 stage BFD linker for LTO plugin
- References: <AANLkTikv7BJPnkcgvh-JgnqJ2sKpB07GQm5U-Rzkcp9e@mail.gmail.com>
On Fri, Dec 3, 2010 at 10:07 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Dec 3, 2010 at 6:34 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Fri, Dec 3, 2010 at 6:23 PM, Dave Korn <dave.korn.cygwin@gmail.com> wrote:
>>> On 04/12/2010 01:24, H.J. Lu wrote:
>>>
>>>> I checked in a patch to implement stage 2 linking. Everything
>>>> seems to work, including "gcc -static ... -lm".
>>>
>>> ?Any chance you could send a complete diff?
>>>
>>
>> I will submit a complete diff after I fix a few corner cases.
>> In the meantime, you can clone my git tree and do a "git diff".
>>
>
> Hi,
>
> This patch implements 2 stage BFD linker for LTO plugin.
> It works with current LTO API on all cases I tested.
>
> Known issue: ?--whole-archive will call plugin on archives with IR
> in stage 2 linking. But ld never calls plugin to get back object files.
> I will try to avoid it in a follow up patch.
>
This turns out not a problem. In stage 2 linking, for --whole-archive
we call plugin to get symbols in the IR element of an archive and
it will be ignored for stage 2 linking. It is OK since we already get
the trans object files back for stage 2 linking.
BTW, the new linker passed bootstrap-lto with all default languages.
I am planning to include this patch in the next Linux binutils.
--
H.J.