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
This commit is contained in:
Felix Kuehling
2016-01-22 18:08:19 -05:00
parent 7416805a44
commit cc7491ec71
+1 -1
View File
@@ -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 \