diff options
author | Stuart Henderson <sthen@cvs.openbsd.org> | 2022-08-20 14:11:32 +0000 |
---|---|---|
committer | Stuart Henderson <sthen@cvs.openbsd.org> | 2022-08-20 14:11:32 +0000 |
commit | 831bd30b070c7e8308c5b2451e1d490e0845d550 (patch) | |
tree | cc018354bce75d3e8e9e91b7577cbb022ca08edb /libexec/ld.so/library_mquery.c | |
parent | e62a5b18546bf202b9dd8d7ca814713457cd223b (diff) |
Support RTLD_NOLOAD in ld.so. From guenther@. OK jca@ guenther@
Diffstat (limited to 'libexec/ld.so/library_mquery.c')
-rw-r--r-- | libexec/ld.so/library_mquery.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/libexec/ld.so/library_mquery.c b/libexec/ld.so/library_mquery.c index 714816e9839..29893bdc6b2 100644 --- a/libexec/ld.so/library_mquery.c +++ b/libexec/ld.so/library_mquery.c @@ -1,4 +1,4 @@ -/* $OpenBSD: library_mquery.c,v 1.66 2022/01/08 06:49:41 guenther Exp $ */ +/* $OpenBSD: library_mquery.c,v 1.67 2022/08/20 14:11:31 sthen Exp $ */ /* * Copyright (c) 2002 Dale Rahn @@ -134,18 +134,15 @@ _dl_tryload_shlib(const char *libname, int type, int flags) for (object = _dl_objects; object != NULL; object = object->next) { if (object->dev == sb.st_dev && object->inode == sb.st_ino) { - object->obj_flags |= flags & DF_1_GLOBAL; _dl_close(libfile); - if (_dl_loading_object == NULL) - _dl_loading_object = object; - if (object->load_object != _dl_objects && - object->load_object != _dl_loading_object) { - _dl_link_grpref(object->load_object, - _dl_loading_object); - } + _dl_handle_already_loaded(object, flags); return(object); } } + if (flags & DF_1_NOOPEN) { + _dl_close(libfile); + return NULL; + } _dl_read(libfile, hbuf, sizeof(hbuf)); ehdr = (Elf_Ehdr *)hbuf; |