Three more days left before the 2.30 release...

H.J. Lu hjl.tools@gmail.com
Sat Jan 27 22:26:00 GMT 2018


On Sat, Jan 27, 2018 at 1:59 PM, Alan Modra <amodra@gmail.com> wrote:
> On Sat, Jan 27, 2018 at 09:09:55AM +1030, Alan Modra wrote:
>> On Fri, Jan 26, 2018 at 01:42:12PM -0800, H.J. Lu wrote:
>> > On Wed, Jan 24, 2018 at 9:08 AM, Nick Clifton <nickc@redhat.com> wrote:
>> > > Hi Guys,
>> > >
>> > >   We seem to be on track for creating the 2.30 release this weekend.
>> > >   So if you have any last minute, can't-live-without bug fixes that
>> > >   you want to see in the release, now is the time to submit them.
>> > >
>> >
>> > This is a LTO regression on 2.30 branch:
>> >
>> > https://sourceware.org/bugzilla/show_bug.cgi?id=22751
>>
>> I doubt I can fix this one in time.
>>
>> Reverting the patch is an option.  Even though that will result in
>> .eh_frame for recompiled objects being placed after the terminating
>> zero in crtend.o, I don't think that will be a problem unless eh_frame
>> optimization is disabled with ld -traditional-format.
>
> So what was happening was that the file added from libgcc.a during the
> rescan was not put on file_chain.  map_input_to_output_sections then
> doesn't see the file and its sections are treated as discarded.
>
> The file_chain list pointer bug was caused by that fact that an
> archive element claimed by the plugin does not have my_archive set.
> Or more correctly, the actual archive element does have my_archive
> set, but this bfd is replaced with a dummy that doesn't have
> my_archive set.
>
>         PR 22751
>         * ldlang.c (find_rescan_insertion): Look past bfds with claim_archive
>         set.
>
> diff --git a/ld/ldlang.c b/ld/ldlang.c
> index 1526d7b..001039d 100644
> --- a/ld/ldlang.c
> +++ b/ld/ldlang.c
> @@ -7044,7 +7044,8 @@ find_rescan_insertion (lang_input_statement_type *add)
>    for (iter = before ? &before->next : &file_chain.head->input_statement.next;
>         *iter != NULL;
>         iter = &(*iter)->input_statement.next)
> -    if ((*iter)->input_statement.the_bfd->my_archive == NULL)
> +    if (!(*iter)->input_statement.flags.claim_archive
> +       && (*iter)->input_statement.the_bfd->my_archive == NULL)
>        break;
>
>    return iter;
>

Great.  You can include my testcase patch with your fix:

https://sourceware.org/ml/binutils/2018-01/msg00380.html

Thanks.

-- 
H.J.



More information about the Binutils mailing list