Record dynamic dependencies in .note.dlopen elf section

This commit is contained in:
Anonymous Maarten
2025-08-27 18:11:39 +02:00
committed by GitHub
parent 152ba829a1
commit 0a6b80717c
26 changed files with 435 additions and 36 deletions

View File

@@ -24,12 +24,20 @@
#ifdef SDL_USE_LIBDBUS
// we never link directly to libdbus.
static const char *dbus_library = "libdbus-1.so.3";
#define SDL_DRIVER_DBUS_DYNAMIC "libdbus-1.so.3"
static const char *dbus_library = SDL_DRIVER_DBUS_DYNAMIC;
static SDL_SharedObject *dbus_handle = NULL;
static char *inhibit_handle = NULL;
static unsigned int screensaver_cookie = 0;
static SDL_DBusContext dbus;
SDL_ELF_NOTE_DLOPEN(
"core-libdbus",
"Support for D-Bus IPC",
SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
SDL_DRIVER_DBUS_DYNAMIC
);
static bool LoadDBUSSyms(void)
{
#define SDL_DBUS_SYM2_OPTIONAL(TYPE, x, y) \

View File

@@ -36,7 +36,22 @@
#include "SDL_evdev_capabilities.h"
#include "../unix/SDL_poll.h"
static const char *SDL_UDEV_LIBS[] = { "libudev.so.1", "libudev.so.0" };
#define SDL_UDEV_FALLBACK_LIBS "libudev.so.1", "libudev.so.0"
static const char *SDL_UDEV_LIBS[] = { SDL_UDEV_FALLBACK_LIBS };
#ifdef SDL_UDEV_DYNAMIC
#define SDL_UDEV_DLNOTE_LIBS SDL_UDEV_DYNAMIC, SDL_UDEV_FALLBACK_LIBS
#else
#define SDL_UDEV_DLNOTE_LIBS SDL_UDEV_FALLBACK_LIBS
#endif
SDL_ELF_NOTE_DLOPEN(
"events-udev",
"Support for events through libudev",
SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
SDL_UDEV_DLNOTE_LIBS
);
static SDL_UDEV_PrivateData *_this = NULL;