tree-wide: drop DLOPEN_FOO() macros

Since 4c0d8d9673, most dlopen notes are
set at the beginning of the executables. Let's manage all dlopen notes
there, rather than setting them where dlopen is called.

Note that the only exceptions are the LIBBPF_NOTE for networkd and
nsresource. Since dlopen_bpf() is wrapped in an `#if` guard, the notes
are instead set within the corresponding functionality.

As a result, the DLOPEN_FOO() wrapper macros are no longer needed and
can be dropped completely.
This commit is contained in:
Yu Watanabe
2026-07-18 04:56:32 +09:00
parent e056e2a707
commit 661ab8b6fd
94 changed files with 223 additions and 233 deletions
-6
View File
@@ -99,12 +99,6 @@ static inline int fd_add_uid_acl_permission(int fd, uid_t uid, unsigned mask) {
int dlopen_libacl(int log_level) _dlopen_loader_;
#define DLOPEN_LIBACL(log_level, priority) \
({ \
LIBACL_NOTE(priority); \
dlopen_libacl(log_level); \
})
int fd_acl_make_read_only(int fd);
int fd_acl_make_writable(int fd);
-6
View File
@@ -70,9 +70,3 @@ int blkid_probe_lookup_value_u64(blkid_probe b, const char *field, uint64_t *ret
#endif
int dlopen_libblkid(int log_level) _dlopen_loader_;
#define DLOPEN_LIBBLKID(log_level, priority) \
({ \
LIBBLKID_NOTE(priority); \
dlopen_libblkid(log_level); \
})
-6
View File
@@ -95,9 +95,3 @@ int bpf_get_error_translated(const void *ptr);
#endif
int dlopen_bpf(int log_level) _dlopen_loader_;
#define DLOPEN_BPF(log_level, priority) \
({ \
LIBBPF_NOTE(priority); \
dlopen_bpf(log_level); \
})
-6
View File
@@ -449,12 +449,6 @@ DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(OpenSSLAskPasswordUI*, openssl_ask_password_ui_
int dlopen_libcrypto(int log_level) _dlopen_loader_;
bool dlopen_libcrypto_has_argon2id(void);
#define DLOPEN_LIBCRYPTO(log_level, priority) \
({ \
LIBCRYPTO_NOTE(priority); \
dlopen_libcrypto(log_level); \
})
typedef struct Argon2IdParameters {
uint64_t memcost_bytes;
uint32_t iterations;
-6
View File
@@ -101,12 +101,6 @@ int cryptsetup_get_volume_key_id(struct crypt_device *cd, const char *volume_nam
int dlopen_cryptsetup(int log_level) _dlopen_loader_;
#define DLOPEN_CRYPTSETUP(log_level, priority) \
({ \
LIBCRYPTSETUP_NOTE(priority); \
dlopen_cryptsetup(log_level); \
})
int cryptsetup_get_keyslot_from_token(sd_json_variant *v);
const char* mangle_none(const char *s);
-6
View File
@@ -78,9 +78,3 @@ DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct curl_slist*, sym_curl_slist_free_
#endif
int dlopen_curl(int log_level) _dlopen_loader_;
#define DLOPEN_CURL(log_level, priority) \
({ \
LIBCURL_NOTE(priority); \
dlopen_curl(log_level); \
})
-6
View File
@@ -90,9 +90,3 @@ int fdisk_partition_set_attrs_as_uint64(struct fdisk_partition *pa, uint64_t fla
#endif
int dlopen_fdisk(int log_level) _dlopen_loader_;
#define DLOPEN_FDISK(log_level, priority) \
({ \
LIBFDISK_NOTE(priority); \
dlopen_fdisk(log_level); \
})
-6
View File
@@ -19,9 +19,3 @@ extern DLSYM_PROTOTYPE(idn2_to_unicode_8z8z);
#endif
int dlopen_idn(int log_level) _dlopen_loader_;
#define DLOPEN_IDN(log_level, priority) \
({ \
LIBIDN2_NOTE(priority); \
dlopen_idn(log_level); \
})
-6
View File
@@ -86,9 +86,3 @@ DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct archive*, sym_archive_read_free,
#endif
int dlopen_libarchive(int log_level) _dlopen_loader_;
#define DLOPEN_LIBARCHIVE(log_level, priority) \
({ \
LIBARCHIVE_NOTE(priority); \
dlopen_libarchive(log_level); \
})
-6
View File
@@ -89,9 +89,3 @@ static inline void* sym_mnt_unref_monitor(struct libmnt_monitor *p) {
#endif
int dlopen_libmount(int log_level) _dlopen_loader_;
#define DLOPEN_LIBMOUNT(log_level, priority) \
({ \
LIBMOUNT_NOTE(priority); \
dlopen_libmount(log_level); \
})
-6
View File
@@ -138,9 +138,3 @@ DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct MHD_Response*, sym_MHD_destroy_re
#endif
int dlopen_microhttpd(int log_level) _dlopen_loader_;
#define DLOPEN_MICROHTTPD(log_level, priority) \
({ \
LIBMICROHTTPD_NOTE(priority); \
dlopen_microhttpd(log_level); \
})
-6
View File
@@ -54,9 +54,3 @@ static inline int module_load_and_warn(struct kmod_ctx *ctx, const char *module,
#endif
int dlopen_libkmod(int log_level) _dlopen_loader_;
#define DLOPEN_LIBKMOD(log_level, priority) \
({ \
LIBKMOD_NOTE(priority); \
dlopen_libkmod(log_level); \
})
-6
View File
@@ -111,9 +111,3 @@ int pam_putenv_assign(pam_handle_t *pamh, const char *name, const char *value);
#endif
int dlopen_libpam(int log_level) _dlopen_loader_;
#define DLOPEN_LIBPAM(log_level, priority) \
({ \
LIBPAM_NOTE(priority); \
dlopen_libpam(log_level); \
})
-7
View File
@@ -166,17 +166,10 @@ static inline bool is_seccomp_available(void) {
return false;
}
#endif
int dlopen_libseccomp(int log_level) _dlopen_loader_;
#define DLOPEN_LIBSECCOMP(log_level, priority) \
({ \
LIBSECCOMP_NOTE(priority); \
dlopen_libseccomp(log_level); \
})
/* This is a special value to be used where syscall filters otherwise expect errno numbers, will be
replaced with real seccomp action. */
enum {
-6
View File
@@ -65,12 +65,6 @@ static inline void freeconp(char **p) {
int dlopen_libselinux(int log_level) _dlopen_loader_;
#define DLOPEN_LIBSELINUX(log_level, priority) \
({ \
LIBSELINUX_NOTE(priority); \
dlopen_libselinux(log_level); \
})
#define _cleanup_freecon_ _cleanup_(freeconp)
/* This accepts 0 error, like _zerook(). */
-6
View File
@@ -48,9 +48,3 @@ DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(SSL_CTX*, sym_SSL_CTX_free, SSL_CTX_free
#endif
int dlopen_libssl(int log_level) _dlopen_loader_;
#define DLOPEN_LIBSSL(log_level, priority) \
({ \
LIBSSL_NOTE(priority); \
dlopen_libssl(log_level); \
})
-6
View File
@@ -59,12 +59,6 @@ int dlopen_tpm2(int log_level) _dlopen_loader_;
* other tokens. */
#define ERRNO_IS_NEG_TPM2_TOKEN_MISMATCH(r) IN_SET(r, -EREMCHG, -ENOANO, -EPERM, -ENOSTR, -EREMOTE, -EADDRNOTAVAIL)
#define DLOPEN_TPM2(log_level, priority) \
({ \
TPM2_NOTE(priority); \
dlopen_tpm2(log_level); \
})
#if HAVE_TPM2
#ifndef SYSTEMD_CFLAGS_MARKER_TPM2
# error "missing tpm2_cflags in meson dependency."