bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/28441] [RISCV] ld linker relaxation is really slow


From: wilson at gcc dot gnu.org
Subject: [Bug ld/28441] [RISCV] ld linker relaxation is really slow
Date: Mon, 11 Oct 2021 23:49:07 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=28441

Jim Wilson <wilson at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wilson at gcc dot gnu.org

--- Comment #1 from Jim Wilson <wilson at gcc dot gnu.org> ---
This is a known problem.  The linker relaxation is O(m*n) where m is the number
of relocations and n is the number of symbols.  So it can be very slow.  Some
large glibc testcases take an hour to link on an Unmatched because of linker
relaxation.  It needs to be rewritten to handle this better.

Some other targets handle this much better.  The microblaze port for instance
collects relaxation changes into a table, the number of bytes to delete at what
address.  Then when it gets to the end of a section, it does all of the
deletions and symbol value updates for the section.  The RISC-V port meanwhile
does the deletions and symbol value updates for each relocation as we process
it, so we are moving section bytes and scanning the symbol table once for each
relocation.  Whereas the microblaze port only does it once per section.

Fixing the RISC-V port to be more like the microblaze port is a major project. 
The problem has been known for the ~4 years since I started doing RISC-V work,
and perhaps even longer, but we have yet to find a volunteer to do the work.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]