Use absolute path for shared object.
diff --git a/regress/liboverride-test.c b/regress/liboverride-test.c
index 136d02f..e431af4 100644
--- a/regress/liboverride-test.c
+++ b/regress/liboverride-test.c
@@ -64,8 +64,11 @@
}
if (getenv("LIBOVERRIDE_SET") == NULL) {
+ char *cwd = getcwd(NULL, 0);
+ char *so = (char *)malloc(strlen(cwd) + 64);
+ sprintf(so, "%s/libliboverride.so", cwd);
setenv("LIBOVERRIDE_SET", "1", 1);
- setenv("LD_PRELOAD", "libliboverride.so", 1);
+ setenv("LD_PRELOAD", so, 1);
execv(argv[0], (void *)argv);
if (verbose) {
printf("exec failed: %s\n", strerror(errno));