diff options
author | 2017-12-12 20:13:16 +0100 | |
---|---|---|
committer | 2017-12-12 20:13:16 +0100 | |
commit | b4b36f4405b7fba0deb2a0d6b5379e7ef66e5c61 (patch) | |
tree | 531946d0b7318aa8bc9c6b37620b6d011ea5966d /meson.build | |
parent | resolve: add support for RFC 8080 (#7600) (diff) | |
download | systemd-b4b36f4405b7fba0deb2a0d6b5379e7ef66e5c61.tar.xz systemd-b4b36f4405b7fba0deb2a0d6b5379e7ef66e5c61.zip |
meson: link NSS modules with -z nodelete (#7607)
We might end up allocating mempools, and when we are unloaded we might
orphan them, thus leaking them. Hence, let's just stick around for good,
so the mempools remain referenced continously and for good, and thus no
memory is leaked (though the memory isn't cleaned up either).
Fixes: #7596
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/meson.build b/meson.build index 7fbe735bbe8..3c57bde5a75 100644 --- a/meson.build +++ b/meson.build @@ -1333,7 +1333,9 @@ foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'], 'src/nss-@0@/nss-@0@.c'.format(module), version : '2', include_directories : includes, - link_args : ['-shared', + # Note that we link NSS modules with '-z nodelete' so that mempools never get orphaned + link_args : ['-Wl,-z,nodelete', + '-shared', '-Wl,--version-script=' + version_script_arg, '-Wl,--undefined'], link_with : [libsystemd_internal, |