Skip to content

Commit

Permalink
libsystemd: link with '-z nodelete'
Browse files Browse the repository at this point in the history
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).

(cherry picked from commit 9d8533b)

Resolves: RHEL-6589
  • Loading branch information
msekletar committed May 23, 2024
1 parent 16eace4 commit cec054d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2004,6 +2004,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,
libbasic_gcrypt,
Expand Down

0 comments on commit cec054d

Please sign in to comment.