mirror of
https://github.com/rui314/mold.git
synced 2024-10-04 16:48:04 +03:00
d0c1c4db19
To process version scriots, we have to match glob patterns against symbol strings. Sometimes, we have hundreds or thousands of glob patterns and have to match them against millions of mangled long C++ symbol names. This step can be very slow. In this patch, I implemented the Aho-Corasick algorithm to match glob patterns to symbol strings as quickly as possible. For the details of the algorithm, see https://en.wikipedia.org/wiki/Glob_(programming). This patch improves mold's performance for programs that uses large version scripts. For example, linking libQt6Gui.so.6.3.0 reduced from 1.10s to 0.05s with this patch. This patch also changes how symbol versions are applied if two or more version patterns match to a single symbol string. Previously, the last one in a script file took precedence. Now, the first one takes precedence. I believe the new behavior is compatible with GNU ld. Fixes https://github.com/rui314/mold/issues/156 Fixed https://github.com/rui314/mold/issues/287 |
||
---|---|---|
.. | ||
elf | ||
macho | ||
gentoo-test.sh | ||
Makefile.darwin | ||
Makefile.linux |