PR30724, cygwin ld performance regression since 014a602b86

Alan Modra amodra@gmail.com
Wed Aug 9 22:21:05 GMT 2023


On Wed, Aug 09, 2023 at 04:42:48PM +0200, Clément Chigot wrote:
> On Wed, Aug 9, 2023 at 1:21 AM Alan Modra <amodra@gmail.com> wrote:
> >
> > According to the reporter of this bug the newlib fseek implementation
> > is likely slowed down by locking and fflush, only attempting to
> > optimise seeks when the file is opened read-only.  Thus when writing
> > the output we get a dramatic slowdown due to commit 014a602b86.
> >
> > Clément would you please check that this doesn't regress anything on
> > mingw.
> 
> I'm not seeing any and the issue fixed by 014a602b86 is still fixed so
> it looks good.
> However, I have a question regarding the purpose of bfd_io_force.

It's a flag used to modify the operation of bfd_seek rather than being
the last IO operation performed.  Perhaps I should have done without
that enum value, as all uses of bfd_io_force could be replaced with
bfd_io_seek and given the same result, unless we have code that is
doing multiple bfd_seeks without intervening bfd_reads or bfd_writes.

> Unless bfd_seek fails, it would be overridden right away. So are there
> cases where bfd_seek fails and bfd doesn't report an error, continuing
> to perform inputs/outputs as if nothing happens  ?

Yes, there are cases where code in binutils and gdb does this.  They
are all bugs.  I have a patch, just didn't post yet.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list