Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251209183133.GT3520958@port70.net>
Date: Tue, 9 Dec 2025 19:31:33 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: Rich Felker <dalias@...c.org>, Fabian Rast <fabian.rast@....de>,
	musl@...ts.openwall.com
Subject: Re: [PATCH v2] ldso: skip gnu hash calculation if precomputed

* Szabolcs Nagy <nsz@...t70.net> [2025-12-09 00:14:04 +0100]:
> so there are two optimizations:
> repeat: consecutive relocs referencing the same sym
> local: relocs referencing a locally defined sym
...
> clang:
> !r !l: n  3667  7.8% slen 45.93  7.3% iter 3.70 ff 0.16 hc 3.00 cmp 0.99
>  r !l: n 14255 30.4% slen 35.92 22.1% iter 3.93 ff 0.58 hc 4.48 cmp 1.00
> !r  l: n 20932 44.6% slen 62.88 56.8% iter 3.25 ff 0.14 hc 3.06 cmp 1.00
>  r  l: n  8087 17.2% slen 39.39 13.8% iter 2.93 ff 0.18 hc 3.16 cmp 1.00
> other: n    11  0.0% slen 15.09  0.0% iter 1.00 ff 0.00 hc 0.27 cmp 11.82
> total: n 46952 100.0% slen 49.31 100.0% iter 3.43 ff 0.28 hc 3.50 cmp 1.00

fwiw clang is built with -Bsymbolic-functions[1] and all
the l relocs (locally defined) in libllvm and libclang are
STT_OBJECT, mainly for typeinfo names and vtables which i
guess makes sense to be interposable for templated types
and in the presence of copy relocs for normal types too
(assuming these objects must have a unique address, not
sure if that's the case as they are implementation details)

[1]: https://maskray.me/blog/2021-05-16-elf-interposition-and-bsymbolic
i found this comment:
"As a data point, when building the Linux kernel's x86_64 defconfig
with a clang -fPIC built clang, my build is 15% faster if I add
-Bsymbolic-functions to libLLVM.so and libclang-cpp.so. I cannot
tell the performance difference with a mostly statically linked PIE
clang. From llvm-project 13.0.0 onwards, the build system uses
-Bsymbolic-functions by default."

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.