1
0
mirror of https://github.com/systemd/systemd synced 2024-07-08 20:15:55 +00:00

libsystemd: link with '-z nodelete'

We want to avoid reinitialization of our global variables with static
storage duration in case we get dlopened multiple times by the same
application. This will avoid potential resource leaks that could have
happened otherwise (e.g. leaking journal socket fd).
This commit is contained in:
Michal Sekletar 2024-05-22 17:15:07 +02:00 committed by Luca Boccassi
parent 9fb2db89e3
commit 9d8533b715

View File

@ -2069,6 +2069,8 @@ libsystemd = shared_library(
version : libsystemd_version,
include_directories : libsystemd_includes,
link_args : ['-shared',
# Make sure our library is never deleted from memory, so that our open logging fds don't leak on dlopen/dlclose cycles.
'-z', 'nodelete',
'-Wl,--version-script=' + libsystemd_sym_path],
link_with : [libbasic],
link_whole : [libsystemd_static],