From cc7491ec7191562d93e102a2b6b76a29a956e0ae Mon Sep 17 00:00:00 2001 From: Felix Kuehling Date: Fri, 22 Jan 2016 18:08:19 -0500 Subject: [PATCH] Link libhsakmt with -z nodelete This prevents the library from being unloaded at runtime, even when dlclose is called. This preserves global variables, such as state about the SVM address space and avoids catastrophic leaks on dlclose. Change-Id: I34f1d19a450835200e9d4815458e8d1b3045053c --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 03ce54e07e..143385b5f6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -20,7 +20,7 @@ ifneq ($(REL),1) CFLAGS += -ggdb endif -LDFLAGS += -lrt -pthread -Wl,--version-script=libhsakmt.ver -Wl,-soname=$(LIB_NAME).$(LIB_MAJOR_VER) +LDFLAGS += -lrt -pthread -Wl,--version-script=libhsakmt.ver -Wl,-soname=$(LIB_NAME).$(LIB_MAJOR_VER) -Wl,-z,nodelete OBJS = debug.o globals.o memory.o perfctr.o time.o version.o \ events.o openclose.o queues.o topology.o fmm.o pmc_table.o \