]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: drop explicit dlopen notes from test executables
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 7 Jul 2026 00:10:57 +0000 (09:10 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 Jul 2026 07:29:54 +0000 (16:29 +0900)
Typically, we do not explicitly set dlopen note on test binaries.

If we should set notes, let's do that consistently later.

src/resolve/test-dnssec-crypto.c
src/test/gcrypt-util.c
src/test/gcrypt-util.h
src/test/test-bpf-restrict-fsaccess.c
src/test/test-bpf-token.c
src/test/test-fsprg.c

index 82a91a6386c269b822e1e2259a08a4e6afebe73c..c080a83418e3b62b41ede99e33084c56870d4bdd 100644 (file)
@@ -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;
index 6197ddb9c27e4c91288ca68ee10eb953286c9d46..7ab06571001b76c523d848399dd7db60ef0762a1 100644 (file)
@@ -1,9 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <sys/syslog.h>
-
-#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,
index 37eb3f5b61922e3eafc19bb47fef225c0a8fa62a..2d6c6a0a0a4a692931f63cac7f5faf2de94a682d 100644 (file)
@@ -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 <gcrypt.h> /* 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
index 776d75eaec8c06472a66dcd8e4815babe18cf8b2..6df10728eb417d99a86f57a89c454d663cbf6b8a 100644 (file)
@@ -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");
 
index f7156f7ff537ac46db97f88b96a6ab473c7b3122..f991f92601271a7b8e2c2bcf22d69e20a545296b 100644 (file)
@@ -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;
 
index 94183e2246202e04cd0cf0157a95f15a137b6d99..73103abcd7444d0a1ce07f4ab3fe9180ad71dc5b 100644 (file)
@@ -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;