]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-dlopen: introduce SD_ELF_NOTE_DLOPEN_ANCHORED() macro
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 4 Jul 2026 20:51:27 +0000 (05:51 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 Jul 2026 07:29:54 +0000 (16:29 +0900)
commitaa0db003cf537aeb051cc51a2f7e95d51a5756cd
treecc9aa4f72f5011b3df2535382e05b02cd1cdd58c
parent19d562b0beae6160ee4f0a8722fcace3f759827e
sd-dlopen: introduce SD_ELF_NOTE_DLOPEN_ANCHORED() macro

SD_ELF_NOTE_DLOPEN_ANCHORED() emits a .note.dlopen ELF note that is
"anchored" to a dummy symbol via the SHF_LINK_ORDER ('o') section flag,
in addition to SHF_GROUP ('G') for folding identical notes together.

Unlike the plain SD_ELF_NOTE_DLOPEN() macro, this variant ties the
note's lifetime to a dummy symbol named with the specified tag: if the
linker's --gc-sections removes the function that calls the macro (e.g.
because the function is never referenced), the associated .note.dlopen
entry is garbage-collected along with it.

Currently, the new macro is unused in our code, but all dlopen notes
will be generated with this in later commits.
src/systemd/sd-dlopen.h