From dc04fdfe804d20f393b5e25ccabf351198042a9a Mon Sep 17 00:00:00 2001 From: Lenny Komow Date: Thu, 18 May 2017 14:02:26 -0600 Subject: loader: Revert ICD dlopen back to using RTLD_LAZY Change-Id: I53ae66929ed38d81eb52cc0307341d5c8f97cdc8 --- loader/vk_loader_platform.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'loader') diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h index 40656534..c1ae0d85 100644 --- a/loader/vk_loader_platform.h +++ b/loader/vk_loader_platform.h @@ -98,10 +98,11 @@ static inline char *loader_platform_dirname(char *path) { return dirname(path); // Dynamic Loading of libraries: typedef void *loader_platform_dl_handle; static inline loader_platform_dl_handle loader_platform_open_library(const char *libPath) { - // When loading the library, we need to make sure we load it with RTLD_NOW to force - // symbol resolution at the time of load. This way, we make sure that all appropriate - // symbols are there. - return dlopen(libPath, RTLD_NOW | RTLD_LOCAL); + // When loading the library, we use RTLD_LAZY so that not all symbols have to be + // resolved at this time (which improves performance). Note that if not all symbols + // can be resolved, this could cause crashes later. Use the LD_BIND_NOW environment + // variable to force all symbols to be resolved here. + return dlopen(libPath, RTLD_LAZY | RTLD_LOCAL); } static inline const char *loader_platform_open_library_error(const char *libPath) { return dlerror(); } static inline void loader_platform_close_library(loader_platform_dl_handle library) { dlclose(library); } -- cgit v1.2.3