diff options
author | jdp <jdp@FreeBSD.org> | 1999-08-30 01:50:41 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 1999-08-30 01:50:41 +0000 |
commit | 7a67a7ee048e83361dbd4afda5c84ff0b8646542 (patch) | |
tree | 997498cd3ff38258372b4f509859c44bd0498400 /libexec/rtld-elf/map_object.c | |
parent | 4382ccec34f7f0bb2721459e301575176a175688 (diff) | |
download | FreeBSD-src-7a67a7ee048e83361dbd4afda5c84ff0b8646542.zip FreeBSD-src-7a67a7ee048e83361dbd4afda5c84ff0b8646542.tar.gz |
When checking to see if a shared object is already loaded, look for
a device/inode match if no pathname match is found.
Diffstat (limited to 'libexec/rtld-elf/map_object.c')
-rw-r--r-- | libexec/rtld-elf/map_object.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libexec/rtld-elf/map_object.c b/libexec/rtld-elf/map_object.c index 42cb3e5..ca353c7 100644 --- a/libexec/rtld-elf/map_object.c +++ b/libexec/rtld-elf/map_object.c @@ -27,6 +27,7 @@ #include <sys/param.h> #include <sys/mman.h> +#include <sys/stat.h> #include <errno.h> #include <stddef.h> @@ -47,7 +48,7 @@ static int protflags(int); /* Elf flags -> mmap protection */ * for the shared object. Returns NULL on failure. */ Obj_Entry * -map_object(int fd, const char *path) +map_object(int fd, const char *path, const struct stat *sb) { Obj_Entry *obj; union { @@ -228,6 +229,10 @@ map_object(int fd, const char *path) } obj = obj_new(); + if (sb != NULL) { + obj->dev = sb->st_dev; + obj->ino = sb->st_ino; + } obj->mapbase = mapbase; obj->mapsize = mapsize; obj->textsize = round_page(segs[0]->p_vaddr + segs[0]->p_memsz) - |