diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-07-20 22:53:54 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-07-20 22:53:54 +0000 |
commit | bf8b3e74bfdc50935445c324f8dc03025a6f2419 (patch) | |
tree | 0f45dcac18a219c2743bd0b5e99d3e7b25f6131c /elf/dl-load.c | |
parent | 5e61ef88485aad8392c15956d6097285db3f2955 (diff) | |
download | glibc-bf8b3e74bfdc50935445c324f8dc03025a6f2419.tar.gz glibc-bf8b3e74bfdc50935445c324f8dc03025a6f2419.tar.xz glibc-bf8b3e74bfdc50935445c324f8dc03025a6f2419.zip |
Update.
* elf/elf.h: Add various DF_1_*, DTF_1_*, and DF_P1_* entries. * elf/dl-close.c (_dl_close): Don't close an object if it is marked with nodelete. * elf/dl-open.c (dl_open_worker): Pass RTLD_NOLOAD as new parameter to _dl_map_object. Return immediately if no object loaded. Set DF_1_NODELETE bit in l_flags_1 if RTLD_NODELETE was passed. * elf/dynamic-link.h (elf_get_dynamic_info): Copy DT_FLAGS_1 entry if it exists into l_flags_1 word. * elf/dl-load.c (_dl_map_object_from_fd): Take no parameter and use it to determine whether loading is wanted or not. (_dl_map_object): Likewise. Call _dl_map_object_from_fd with new parameter. * sysdeps/generic/ldsodefs.h: Update prototype. * elf/dl-deps.c: Add new parameter to _dl_map_object calls. * elf/rtld.c: Likewise. * elf/Makefile (tests): Add noload. Add rules to generate noload. * elf/noload.c: New file. * include/link.h (struct link_map): Add l_feature_1 and l_flags_1. * sysdeps/generic/bits/dlfcn.h: Define RTLD_NOLOAD and RTLD_NODELETE. * sysdeps/mips/bits/dlfcn.h: Likewise.
Diffstat (limited to 'elf/dl-load.c')
-rw-r--r-- | elf/dl-load.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c index 2c506b55c1..fbf82e2068 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -688,7 +688,7 @@ static #endif struct link_map * _dl_map_object_from_fd (const char *name, int fd, char *realname, - struct link_map *loader, int l_type) + struct link_map *loader, int l_type, int noload) { /* This is the expected ELF header. */ #define ELF32_CLASS ELFCLASS32 @@ -752,6 +752,11 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname, return l; } + if (noload) + /* We are not supposed to load the object unless it is already + loaded. So return now. */ + return NULL; + /* Print debugging message. */ if (__builtin_expect (_dl_debug_files, 0)) _dl_debug_message (1, "file=", name, "; generating link map\n", NULL); @@ -1301,7 +1306,7 @@ open_path (const char *name, size_t namelen, int preloaded, struct link_map * internal_function _dl_map_object (struct link_map *loader, const char *name, int preloaded, - int type, int trace_mode) + int type, int trace_mode, int noload) { int fd; char *realname; @@ -1501,5 +1506,5 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded, _dl_signal_error (errno, name, N_("cannot open shared object file")); } - return _dl_map_object_from_fd (name, fd, realname, loader, type); + return _dl_map_object_from_fd (name, fd, realname, loader, type, noload); } |