aboutsummaryrefslogtreecommitdiff
path: root/loader
diff options
context:
space:
mode:
authorLenny Komow <lenny@lunarg.com>2017-05-18 14:02:26 -0600
committerLenny Komow <lenny@lunarg.com>2017-05-18 15:04:31 -0600
commitdc04fdfe804d20f393b5e25ccabf351198042a9a (patch)
tree874da61ce06b19c009faf40d1631abd561796565 /loader
parent92732bc3bc4683cd32c7629c624e2197d3abe1d8 (diff)
downloadusermoji-dc04fdfe804d20f393b5e25ccabf351198042a9a.tar.xz
loader: Revert ICD dlopen back to using RTLD_LAZY
Change-Id: I53ae66929ed38d81eb52cc0307341d5c8f97cdc8
Diffstat (limited to 'loader')
-rw-r--r--loader/vk_loader_platform.h9
1 files changed, 5 insertions, 4 deletions
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); }