This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Proposed patch] Huge performance regression in ld -r since binutils >= 2.21
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: Romain Geissler <romain dot geissler at amadeus dot com>, Binutils <binutils at sourceware dot org>
- Date: Tue, 10 Nov 2015 04:58:21 -0800
- Subject: Re: [Proposed patch] Huge performance regression in ld -r since binutils >= 2.21
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LNX dot 2 dot 10 dot 1511061715270 dot 27094 at ncegcolnx273 dot nce dot amadeus dot net> <20151109021609 dot GI17177 at bubble dot grove dot modra dot org> <alpine dot LNX dot 2 dot 10 dot 1511090942340 dot 3815 at ncegcolnx273 dot nce dot amadeus dot net> <20151110065120 dot GM17177 at bubble dot grove dot modra dot org> <CAMe9rOrMnopydtJiynn=fZkL2GNfMsx93f0MgWr=6o4+o4PckQ at mail dot gmail dot com> <20151110091719 dot GA26095 at bubble dot grove dot modra dot org>
On Tue, Nov 10, 2015 at 1:17 AM, Alan Modra <amodra@gmail.com> wrote:
> On Tue, Nov 10, 2015 at 12:24:32AM -0800, H.J. Lu wrote:
>> On Mon, Nov 9, 2015 at 10:51 PM, Alan Modra <amodra@gmail.com> wrote:
>> > On Mon, Nov 09, 2015 at 10:04:42AM +0100, Romain Geissler wrote:
>>>> Indeed, much better idea. I will use your patch and apply it to x86/64 as
>> >> well.
>> >
>> > On checking I found I'd made a mistake in the previous patch, so
>> > decided to go with the safer approach of copying relocs at the end of
>> > the loop. Also, I'm not renaming "rel" to "rrel".
>> >
>> > * elf64-ppc.c (ppc64_elf_relocate_section): Use read and write
>> > pointers to reloc array, rather than memmove when deleting a
>> > reloc. Don't use RELOC_AGAINST_DISCARDED_SECTION. Adjust
>> > reloc counts at end of loop.
>> > * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
>> >
>>
>> I checked in a similar, but a little different, patch to fix i386 and
>> x86-64.
>
> You deleted a comment line, and need to look at all the "continue"
> statements. I see one that must copy relocs, and more that should
> copy *or* you should remove the copying code at the end of the loop.
>
> To clarify, I decided to add what is dead code to the powerpc backend
> in case we ever remove relocs when !relocatable. The only copying
> that is really needed is this one:
>
> if (bfd_link_relocatable (info))
> {
> if (wrel != rel)
> *wrel = *rel;
> continue;
> }
I have checked a patch into x86 backends,
> and you need to add the missing VTINHERIT/VTENTRY copy..
>
Done,
Thanks,
--
H.J.