mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
Symbols exported by libshared can't get pruned by the linker, so every unused exported symbol is effectively dead code we ship to users for no good reason. Let's add a script to analyze how many such symbols we have. We also add a meson test to run the script on all of our binaries. Since it detects unused symbols and still has a few false positives, don't enable the test by default similar to the clang-tidy tests. The script was 100% vibe coded by Github Copilot with Claude Sonnet 4.5 as the model. Current results are (without the unused symbols list): Analysis of libsystemd-shared-259.so ====================================================================== Total exported symbols: 4830 (excluding public API symbols starting with 'sd_') Used symbols: 4672 Unused symbols: 158 Usage rate: 96.7%