Enable compiler section splitting for functions and data to allow the linker's `--gc-sections` optimization to accurately drop unused code. Note that in highly optimized production builds with Link-Time Optimization (LTO) enabled (such as `-Db_lto=true`), the compiler already performs intensive dead-code elimination, resulting in negligible binary size changes from this change. However, explicit section splitting provides clear benefits in other areas: 1. Significant size reduction for `.standalone` executables and libraries in non-LTO environments. 2. Crucially, it provides the necessary infrastructure for the linker to garbage-collect unused `dlopen` metadata notes implemented in subsequent commits, ensuring precise dependency tracking regardless of the LTO state. Below is a binary size comparison (unstripped) across different build types: - `build-debug`: `-Dbuildtype=debug` - `build-plain`: `-Dbuildtype=plain` (without LTO) - `build-plain-lto`: `-Dbuildtype=plain -Db_lto=true` Before: ``` -rwxr-xr-x 1 watanabe watanabe 6143952 Jul 10 03:10 build-debug/libsystemd.so.0.44.0 -rwxr-xr-x 1 watanabe watanabe 830224 Jul 10 03:10 build-debug/systemd-repart -rwxr-xr-x 1 watanabe watanabe 9107880 Jul 10 03:10 build-debug/systemd-repart.standalone -rwxr-xr-x 1 watanabe watanabe 3581856 Jul 10 03:11 build-plain-lto/libsystemd.so.0.44.0 -rwxr-xr-x 1 watanabe watanabe 515536 Jul 10 03:11 build-plain-lto/systemd-repart -rwxr-xr-x 1 watanabe watanabe 5017000 Jul 10 03:11 build-plain-lto/systemd-repart.standalone -rwxr-xr-x 1 watanabe watanabe 3352616 Jul 10 03:11 build-plain/libsystemd.so.0.44.0 -rwxr-xr-x 1 watanabe watanabe 515232 Jul 10 03:11 build-plain/systemd-repart -rwxr-xr-x 1 watanabe watanabe 5103176 Jul 10 03:11 build-plain/systemd-repart.standalone ``` After: ``` -rwxr-xr-x 1 watanabe watanabe 5424064 Jul 10 03:04 build-debug/libsystemd.so.0.44.0 -rwxr-xr-x 1 watanabe watanabe 850880 Jul 10 03:04 build-debug/systemd-repart -rwxr-xr-x 1 watanabe watanabe 7138496 Jul 10 03:04 build-debug/systemd-repart.standalone -rwxr-xr-x 1 watanabe watanabe 3581856 Jul 10 03:06 build-plain-lto/libsystemd.so.0.44.0 -rwxr-xr-x 1 watanabe watanabe 515536 Jul 10 03:06 build-plain-lto/systemd-repart -rwxr-xr-x 1 watanabe watanabe 5017000 Jul 10 03:06 build-plain-lto/systemd-repart.standalone -rwxr-xr-x 1 watanabe watanabe 2321048 Jul 10 03:06 build-plain/libsystemd.so.0.44.0 -rwxr-xr-x 1 watanabe watanabe 514056 Jul 10 03:06 build-plain/systemd-repart -rwxr-xr-x 1 watanabe watanabe 2716264 Jul 10 03:06 build-plain/systemd-repart.standalone ```
System and Service Manager
Details
Most documentation is available on systemd's web site.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Code Map for information about this repository's layout and content.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list, join our IRC channel #systemd on libera.chat or Matrix channel
Stable branches with backported patches are available in the stable repo.
We have a security bug bounty program sponsored by the Sovereign Tech Fund hosted on YesWeHack
Repositories with distribution packages built from git main are available on OBS, and also repositories with packages built from the latest stable release
