|
NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | NOTES | HISTORY | SEE ALSO | NOTES | COLOPHON |
|
|
|
SD_ELF_NOTE_DLOPEN(3) SD_ELF_NOTE_DLOPEN SD_ELF_NOTE_DLOPEN(3)
SD_ELF_NOTE_DLOPEN, SD_ELF_NOTE_DLOPEN_VENDOR,
SD_ELF_NOTE_DLOPEN_TYPE, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED,
SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED - Embed ELF .note.dlopen
metadata for shared library dependencies
#include <systemd/sd-dlopen.h>
SD_ELF_NOTE_DLOPEN(feature, description, priority, soname...)
#define SD_ELF_NOTE_DLOPEN_VENDOR "FDO"
#define SD_ELF_NOTE_DLOPEN_TYPE UINT32_C(0x407c0c0a)
#define SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED "required"
#define SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED "recommended"
#define SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED "suggested"
SD_ELF_NOTE_DLOPEN() is a macro that embeds a .note.dlopen ELF
note section in the compiled binary, declaring a weak dependency
on a shared library loaded via dlopen(). This implements the ELF
dlopen metadata[1] specification, allowing package managers and
build systems to discover runtime dependencies that are not
visible through regular ELF DT_NEEDED entries.
The macro takes the following parameters:
feature
A short string identifying the feature this library provides
(e.g. "XKB", "PCRE2").
Added in version 261.
description
A human-readable description of what the library is used for.
Added in version 261.
priority
One of SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED,
SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED, or
SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED, indicating how
important the dependency is.
Added in version 261.
soname...
One or more shared object names (sonames) for the library,
e.g. "libfoo.so.1". Multiple sonames may be specified as
separate arguments (up to 5) for libraries that have changed
soname across versions.
Added in version 261.
The embedded metadata can be read from a compiled ELF binary
using:
systemd-analyze dlopen-metadata binary
Example 1. Single soname
#include <systemd/sd-dlopen.h>
SD_ELF_NOTE_DLOPEN("XKB", "Keyboard layout support",
SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
"libxkbcommon.so.0");
Example 2. Multiple sonames for different library versions
SD_ELF_NOTE_DLOPEN("crypt", "Support for hashing passwords",
SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
"libcrypt.so.2", "libcrypt.so.1", "libcrypt.so.1.1");
The macros described here are header-only and do not require
runtime linkage against libsystemd(3). Only the installed header
and include path (as provided by pkg-config --cflags libsystemd)
are needed.
SD_ELF_NOTE_DLOPEN(), SD_ELF_NOTE_DLOPEN_VENDOR,
SD_ELF_NOTE_DLOPEN_TYPE, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED,
SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED, and
SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED were added in version 261.
systemd(1), sd-dlopen(3), dlopen(3)
1. ELF dlopen metadata
https://uapi-group.org/specifications/specs/elf_dlopen_metadata/
This page is part of the systemd (systemd system and service
manager) project. Information about the project can be found at
⟨http://www.freedesktop.org/wiki/Software/systemd⟩. If you have a
bug report for this manual page, see
⟨http://www.freedesktop.org/wiki/Software/systemd/#bugreports⟩.
This page was obtained from the project's upstream Git repository
⟨https://github.com/systemd/systemd.git⟩ on 2026-05-24. (At that
time, the date of the most recent commit that was found in the
repository was 2026-05-24.) If you discover any rendering
problems in this HTML version of the page, or you believe there is
a better or more up-to-date source for the page, or you have
corrections or improvements to the information in this COLOPHON
(which is not part of the original manual page), send a mail to
man-pages@man7.org
systemd 261~rc1 SD_ELF_NOTE_DLOPEN(3)
Pages that refer to this page: sd-dlopen(3), systemd.directives(7), systemd.index(7)