From: Yu Watanabe Date: Tue, 7 Jul 2026 00:10:57 +0000 (+0900) Subject: test: drop explicit dlopen notes from test executables X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=19d562b0beae6160ee4f0a8722fcace3f759827e;p=thirdparty%2Fsystemd.git test: drop explicit dlopen notes from test executables Typically, we do not explicitly set dlopen note on test binaries. If we should set notes, let's do that consistently later. --- diff --git a/src/resolve/test-dnssec-crypto.c b/src/resolve/test-dnssec-crypto.c index 82a91a6386c..c080a83418e 100644 --- a/src/resolve/test-dnssec-crypto.c +++ b/src/resolve/test-dnssec-crypto.c @@ -393,7 +393,7 @@ TEST(dnssec_ecdsa_verify_raw) { } static int intro(void) { - if (DLOPEN_LIBCRYPTO(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0) + if (dlopen_libcrypto(LOG_DEBUG) < 0) return EXIT_TEST_SKIP; return EXIT_SUCCESS; diff --git a/src/test/gcrypt-util.c b/src/test/gcrypt-util.c index 6197ddb9c27..7ab06571001 100644 --- a/src/test/gcrypt-util.c +++ b/src/test/gcrypt-util.c @@ -1,9 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include - -#include "sd-dlopen.h" - #include "gcrypt-util.h" #include "log.h" /* IWYU pragma: keep */ @@ -46,8 +42,6 @@ int dlopen_gcrypt(int log_level) { #if HAVE_GCRYPT static void *gcrypt_dl = NULL; - GCRYPT_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED); - return dlopen_many_sym_or_warn( &gcrypt_dl, "libgcrypt.so.20", log_level, diff --git a/src/test/gcrypt-util.h b/src/test/gcrypt-util.h index 37eb3f5b619..2d6c6a0a0a4 100644 --- a/src/test/gcrypt-util.h +++ b/src/test/gcrypt-util.h @@ -2,8 +2,6 @@ #pragma once -#include "sd-dlopen.h" - #include "basic-forward.h" int dlopen_gcrypt(int log_level); @@ -15,18 +13,6 @@ int initialize_libgcrypt(bool secmem); # error "missing libgcrypt_cflags in meson dependency." #endif -#define GCRYPT_NOTE(priority) \ - SD_ELF_NOTE_DLOPEN("gcrypt", \ - "Support for journald forward-sealing", \ - priority, \ - "libgcrypt.so.20") - -#define DLOPEN_GCRYPT(log_level, priority) \ - ({ \ - GCRYPT_NOTE(priority); \ - dlopen_gcrypt(log_level); \ - }) - #include /* IWYU pragma: export */ #include "dlfcn-util.h" @@ -71,6 +57,4 @@ extern DLSYM_PROTOTYPE(gcry_randomize); } while(false) DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(gcry_md_hd_t, sym_gcry_md_close, NULL); -#else -#define DLOPEN_GCRYPT(log_level, priority) dlopen_gcrypt(log_level) #endif diff --git a/src/test/test-bpf-restrict-fsaccess.c b/src/test/test-bpf-restrict-fsaccess.c index 776d75eaec8..6df10728eb4 100644 --- a/src/test/test-bpf-restrict-fsaccess.c +++ b/src/test/test-bpf-restrict-fsaccess.c @@ -108,7 +108,7 @@ static int do_attach(void) { struct stat st; int r; - r = DLOPEN_BPF(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED); + r = dlopen_bpf(LOG_ERR); if (r < 0) return log_error_errno(r, "Failed to dlopen libbpf: %m"); diff --git a/src/test/test-bpf-token.c b/src/test/test-bpf-token.c index f7156f7ff53..f991f926012 100644 --- a/src/test/test-bpf-token.c +++ b/src/test/test-bpf-token.c @@ -11,7 +11,7 @@ static int run(int argc, char *argv[]) { #if HAVE_LIBBPF int r; - r = DLOPEN_BPF(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED); + r = dlopen_bpf(LOG_ERR); if (r < 0) return r; diff --git a/src/test/test-fsprg.c b/src/test/test-fsprg.c index 94183e22462..73103abcd74 100644 --- a/src/test/test-fsprg.c +++ b/src/test/test-fsprg.c @@ -501,8 +501,8 @@ TEST(hmac) { } static int intro(void) { - if (DLOPEN_GCRYPT(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0 && - DLOPEN_LIBCRYPTO(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0) + if (dlopen_gcrypt(LOG_DEBUG) < 0 && + dlopen_libcrypto(LOG_DEBUG) < 0) return EXIT_TEST_SKIP; return EXIT_SUCCESS;