summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordrahn <drahn@openbsd.org>2001-08-06 15:09:58 +0000
committerdrahn <drahn@openbsd.org>2001-08-06 15:09:58 +0000
commite48c9bf094325b61b9c2ac2a643434d8d751fef1 (patch)
treeebb1a9c05cc94d145a3bc597e3a590f4a81e0260
parentOpenBSD id-tags (diff)
downloadwireguard-openbsd-e48c9bf094325b61b9c2ac2a643434d8d751fef1.tar.xz
wireguard-openbsd-e48c9bf094325b61b9c2ac2a643434d8d751fef1.zip
Change the priority of LD_LIBRARY_PATH, -rpath, and ldconfig path
in ELF ld.so to match the behavior in a.out ld.so. The given order is the new order, previously ldconfig had highest priority, which made it impossible to override.
-rw-r--r--libexec/ld.so/library.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/libexec/ld.so/library.c b/libexec/ld.so/library.c
index 72f8f7aa690..3e89dd60aa7 100644
--- a/libexec/ld.so/library.c
+++ b/libexec/ld.so/library.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: library.c,v 1.7 2001/05/31 13:47:20 art Exp $ */
+/* $OpenBSD: library.c,v 1.8 2001/08/06 15:09:58 drahn Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -71,15 +71,6 @@ _dl_load_shlib(const char *libname, elf_object_t *parent, int type)
struct sod sodp;
char *hint;
- _dl_build_sod(libname, &sodp);
- if ((hint = _dl_findhint((char *)sodp.sod_name, sodp.sod_major,
- sodp.sod_minor, NULL)) != NULL)
- {
- object = _dl_tryload_shlib(hint, type);
- return(object);
-
- }
-
if(_dl_strchr(libname, '/')) {
object = _dl_tryload_shlib(libname, type);
return(object);
@@ -146,6 +137,16 @@ _dl_load_shlib(const char *libname, elf_object_t *parent, int type)
}
}
+ _dl_build_sod(libname, &sodp);
+ if ((hint = _dl_findhint((char *)sodp.sod_name, sodp.sod_major,
+ sodp.sod_minor, NULL)) != NULL)
+ {
+ object = _dl_tryload_shlib(hint, type);
+ return(object);
+
+ }
+
+
/*
* Check '/usr/lib'
*/