Skip to content

Commit 9d8533b

Browse files
msekletarbluca
authored andcommitted
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).
1 parent 9fb2db8 commit 9d8533b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,6 +2069,8 @@ libsystemd = shared_library(
20692069
version : libsystemd_version,
20702070
include_directories : libsystemd_includes,
20712071
link_args : ['-shared',
2072+
# Make sure our library is never deleted from memory, so that our open logging fds don't leak on dlopen/dlclose cycles.
2073+
'-z', 'nodelete',
20722074
'-Wl,--version-script=' + libsystemd_sym_path],
20732075
link_with : [libbasic],
20742076
link_whole : [libsystemd_static],

0 commit comments

Comments
 (0)