]> git.ipfire.org Git - thirdparty/systemd.git/commit
dlopen-note: move all dlopen notes to dlopen-note.h
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 6 Jul 2026 03:16:41 +0000 (12:16 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 Jul 2026 07:34:26 +0000 (16:34 +0900)
commita74b3e1778ec00a21f5d1f10947daef2c02c6ffe
tree95532b38bedc15f5ffce745f9e91c0ae0e0dd697
parentaa0db003cf537aeb051cc51a2f7e95d51a5756cd
dlopen-note: move all dlopen notes to dlopen-note.h

This also switches all these notes to be defined via SD_ELF_NOTE_DLOPEN_ANCHORED().
Consequently, any notes added within unreachable or unused functions will be
automatically garbage-collected by the linker (--gc-sections) instead of
bloating the final binary.

E.g. unused p11-kit library dependency is now dropped from
systemd-repart.standalone binary.

Before:
```
$ systemd-analyze dlopen-metadata build/systemd-repart.standalone
FEATURE    DESCRIPTION                                                SONAME                        PRIORITY
cryptsetup Support for disk encryption, integrity, and authentication libcryptsetup.so.12           recommended
blkid      Support for block device identification                    libblkid.so.1                 required
libcrypto  Support for cryptographic operations                       libcrypto.so.4 libcrypto.so.3 recommended
mount      Support for mount enumeration                              libmount.so.1                 required
fdisk      Support for reading and writing partition tables           libfdisk.so.1                 required
blkid      Support for block device identification                    libblkid.so.1                 recommended
libcrypto  Support for cryptographic operations                       libcrypto.so.4 libcrypto.so.3 suggested
cryptsetup Support for disk encryption, integrity, and authentication libcryptsetup.so.12           suggested
fdisk      Support for reading and writing partition tables           libfdisk.so.1                 suggested
idn        Support for internationalized domain names                 libidn2.so.0                  suggested
mount      Support for mount enumeration                              libmount.so.1                 recommended
selinux    Support for SELinux                                        libselinux.so.1               recommended
tpm        Support for TPM                                            libtss2-esys.so.0             suggested
tpm        Support for TPM                                            libtss2-rc.so.0               suggested
tpm        Support for TPM                                            libtss2-mu.so.0               suggested
tpm        Support for TPM                                            libtss2-tcti-device.so.0      suggested
p11-kit    Support for PKCS11 hardware tokens                         libp11-kit.so.0               suggested
```

After:
```
$ systemd-analyze dlopen-metadata build/systemd-repart.standalone
FEATURE    DESCRIPTION                                                SONAME                        PRIORITY
cryptsetup Support for disk encryption, integrity, and authentication libcryptsetup.so.12           recommended
blkid      Support for block device identification                    libblkid.so.1                 required
libcrypto  Support for cryptographic operations                       libcrypto.so.4 libcrypto.so.3 recommended
mount      Support for mount enumeration                              libmount.so.1                 required
fdisk      Support for reading and writing partition tables           libfdisk.so.1                 required
blkid      Support for block device identification                    libblkid.so.1                 recommended
libcrypto  Support for cryptographic operations                       libcrypto.so.4 libcrypto.so.3 suggested
cryptsetup Support for disk encryption, integrity, and authentication libcryptsetup.so.12           suggested
fdisk      Support for reading and writing partition tables           libfdisk.so.1                 suggested
mount      Support for mount enumeration                              libmount.so.1                 recommended
selinux    Support for SELinux                                        libselinux.so.1               recommended
tpm        Support for TPM                                            libtss2-esys.so.0             suggested
tpm        Support for TPM                                            libtss2-rc.so.0               suggested
tpm        Support for TPM                                            libtss2-mu.so.0               suggested
tpm        Support for TPM                                            libtss2-tcti-device.so.0      suggested
```
114 files changed:
meson.build
src/analyze/analyze-security.c
src/basic/compress.c
src/basic/dlopen-note.h [new file with mode: 0644]
src/bootctl/bootctl-install.c
src/core/bpf-bind-iface.c
src/core/bpf-restrict-fs.c
src/core/bpf-restrict-fsaccess.c
src/core/bpf-restrict-ifaces.c
src/core/bpf-socket-bind.c
src/core/exec-invoke.c
src/core/execute.c
src/core/main.c
src/core/mount.c
src/core/namespace.c
src/core/selinux-setup.c
src/creds/creds.c
src/cryptenroll/cryptenroll-varlink.c
src/cryptenroll/cryptenroll.c
src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-fido2.c
src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-pkcs11.c
src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-tpm2.c
src/cryptsetup/cryptsetup.c
src/dissect/dissect.c
src/growfs/growfs.c
src/home/homectl.c
src/home/homed-manager.c
src/home/homework-fscrypt.c
src/home/homework-luks.c
src/home/homework.c
src/home/pam_systemd_home.c
src/imds/imdsd.c
src/import/import-common.c
src/import/pull-job.c
src/integritysetup/integritysetup.c
src/journal-remote/journal-gatewayd.c
src/journal-remote/journal-remote-main.c
src/journal-remote/journal-upload.c
src/journal/journalctl-authenticate.c
src/keyutil/keyutil.c
src/locale/xkbcommon-util.c
src/login/pam_systemd.c
src/login/pam_systemd_loadkey.c
src/measure/measure-tool.c
src/network/networkd-sysctl.c
src/nspawn/nspawn-oci.c
src/nspawn/nspawn.c
src/nsresourced/userns-restrict.c
src/pcrextend/pcrextend.c
src/pcrlock/pcrlock.c
src/portable/portable.c
src/repart/repart.c
src/report/report-sign-plain.c
src/report/report-upload.c
src/resolve/resolved-dns-dnssec.c
src/resolve/resolved-dnstls.c
src/resolve/resolved-util.c
src/sbsign/sbsign.c
src/shared/acl-util.c
src/shared/acl-util.h
src/shared/apparmor-util.c
src/shared/blkid-util.c
src/shared/blkid-util.h
src/shared/bpf-util.c
src/shared/bpf-util.h
src/shared/crypto-util.c
src/shared/crypto-util.h
src/shared/cryptsetup-util.c
src/shared/cryptsetup-util.h
src/shared/curl-util.c
src/shared/curl-util.h
src/shared/dlopen-note.h [new file with mode: 0644]
src/shared/elf-util.c
src/shared/fdisk-util.c
src/shared/fdisk-util.h
src/shared/gnutls-util.c
src/shared/idn-util.c
src/shared/idn-util.h
src/shared/libarchive-util.c
src/shared/libarchive-util.h
src/shared/libaudit-util.c
src/shared/libcrypt-util.c
src/shared/libfido2-util.c
src/shared/libmount-util.c
src/shared/libmount-util.h
src/shared/microhttpd-util.c
src/shared/microhttpd-util.h
src/shared/module-util.c
src/shared/module-util.h
src/shared/pam-util.c
src/shared/pam-util.h
src/shared/password-quality-util-passwdqc.c
src/shared/password-quality-util-pwquality.c
src/shared/pcre2-util.c
src/shared/pkcs11-util.c
src/shared/qrcode-util.c
src/shared/seccomp-util.c
src/shared/seccomp-util.h
src/shared/selinux-util.c
src/shared/selinux-util.h
src/shared/ssl-util.c
src/shared/ssl-util.h
src/shared/tpm2-util.c
src/shared/tpm2-util.h
src/shutdown/detach-swap.c
src/sysext/sysext.c
src/sysupdate/sysupdate-partition.c
src/sysupdate/sysupdate-resource.c
src/tmpfiles/tmpfiles.c
src/tpm2-setup/tpm2-setup.c
src/udev/udev-builtin-blkid.c
src/udev/udevd.c
src/validatefs/validatefs.c
src/veritysetup/veritysetup.c