diff options
author | kib <kib@FreeBSD.org> | 2009-11-28 14:29:32 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-11-28 14:29:32 +0000 |
commit | d9873126f6ca1d91a7453a54be79b6408e5f4fd6 (patch) | |
tree | bacc69922237d84811b40bb330d499b326d20c2a /libexec | |
parent | d5471c00ab40037aae48b7e58ddd5599c833675f (diff) | |
download | FreeBSD-src-d9873126f6ca1d91a7453a54be79b6408e5f4fd6.zip FreeBSD-src-d9873126f6ca1d91a7453a54be79b6408e5f4fd6.tar.gz |
Allow to load not-openable dso when tracing. This fixes ldd on such dso or
dso linked to non-openable object.
Remove '\n' at the end of error message.
End comments with dot.
MFC after: 3 weeks (together with r199829)
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/rtld-elf/rtld.c | 7 | ||||
-rw-r--r-- | libexec/rtld-elf/rtld.h | 5 |
2 files changed, 8 insertions, 4 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 320aa85..bffae60 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -1571,9 +1571,10 @@ do_load_object(int fd, const char *name, char *path, struct stat *sbp, object_add_name(obj, name); obj->path = path; digest_dynamic(obj, 0); - if (obj->z_noopen && (flags & RTLD_LO_DLOPEN)) { + if (obj->z_noopen && (flags & (RTLD_LO_DLOPEN | RTLD_LO_TRACE)) == + RTLD_LO_DLOPEN) { dbg("refusing to load non-loadable \"%s\"", obj->path); - _rtld_error("Cannot dlopen non-loadable %s\n", obj->path); + _rtld_error("Cannot dlopen non-loadable %s", obj->path); munmap(obj->mapbase, obj->mapsize); obj_free(obj); return (NULL); @@ -2006,6 +2007,8 @@ dlopen(const char *name, int mode) lo_flags = RTLD_LO_DLOPEN; if (mode & RTLD_NOLOAD) lo_flags |= RTLD_LO_NOLOAD; + if (ld_tracing != NULL) + lo_flags |= RTLD_LO_TRACE; objlist_init(&initlist); diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 6f51d7d..875e84b 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -242,8 +242,9 @@ typedef struct Struct_Obj_Entry { dlsym. */ /* Flags for load_object(). */ -#define RTLD_LO_NOLOAD 0x01 /* dlopen() specified RTLD_NOLOAD */ -#define RTLD_LO_DLOPEN 0x02 /* load_object() called from dlopen(). */ +#define RTLD_LO_NOLOAD 0x01 /* dlopen() specified RTLD_NOLOAD. */ +#define RTLD_LO_DLOPEN 0x02 /* Load_object() called from dlopen(). */ +#define RTLD_LO_TRACE 0x04 /* Only tracing. */ /* * Symbol cache entry used during relocation to avoid multiple lookups |