[libvirt] [PATCH 01/14] build: prevent unloading of all public libraries

Daniel P. Berrangé berrange at redhat.com
Thu Apr 19 17:09:49 UTC 2018


We previously added "-z nodelete" to the build of libvirt.so to prevent
crashes when thread local destructors run which point to a code that
has been dlclose()d:

  commit 384b9a76a5e387f64cfe8f83f4a518bb302e80f7
  Author: Daniel P. Berrangé <berrange at redhat.com>
  Date:   Thu Apr 19 11:42:22 2018 +0100

    driver: prevent unloading of dlopen'd modules

We forgot to copy this protection into the libvirt-qemu.so, libvirt-lxc.so
and libvirt-admin.so libraries when we introduced them.

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 src/Makefile.am | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index a6667228b6..2f8e5f6908 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -529,7 +529,9 @@ libvirt_admin_la_SOURCES = \
 libvirt_admin_la_LDFLAGS = \
 		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE) \
 		-version-info $(LIBVIRT_VERSION_INFO) \
-		$(AM_LDFLAGS)
+		$(LIBVIRT_NODELETE) \
+		$(AM_LDFLAGS) \
+		$(NULL)
 
 libvirt_admin_la_LIBADD = \
 		libvirt.la \
@@ -644,6 +646,7 @@ libvirt_qemu_la_SOURCES = libvirt-qemu.c
 libvirt_qemu_la_LDFLAGS = \
 		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
 		-version-info $(LIBVIRT_VERSION_INFO) \
+		$(LIBVIRT_NODELETE) \
 		$(AM_LDFLAGS) \
 		$(NULL)
 libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
@@ -653,6 +656,7 @@ libvirt_lxc_la_SOURCES = libvirt-lxc.c
 libvirt_lxc_la_LDFLAGS = \
 		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
 		-version-info $(LIBVIRT_VERSION_INFO) \
+		$(LIBVIRT_NODELETE) \
 		$(AM_LDFLAGS) \
 		$(NULL)
 libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
-- 
2.14.3




More information about the libvir-list mailing list