diff options
author | Matthew Dempsky <matthew@cvs.openbsd.org> | 2012-06-12 20:32:18 +0000 |
---|---|---|
committer | Matthew Dempsky <matthew@cvs.openbsd.org> | 2012-06-12 20:32:18 +0000 |
commit | 91fdb014ed90496950b50dbb2772fb6ab6c8c192 (patch) | |
tree | ef656df93cd90a68e9b01af135a1c5e6336b9954 /libexec/ld.so/sod.c | |
parent | f4a08bb56d5f8ea5b017994e474596a56ac36221 (diff) |
Fix loaded object sod matching: when we load libfoo.so.X.Y into
memory, we should be able to match other requests for libfoo.so.X.Z
against that same object.
ok kurt, kettenis
Diffstat (limited to 'libexec/ld.so/sod.c')
-rw-r--r-- | libexec/ld.so/sod.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libexec/ld.so/sod.c b/libexec/ld.so/sod.c index 7b421b24c54..9c3c64df3c9 100644 --- a/libexec/ld.so/sod.c +++ b/libexec/ld.so/sod.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sod.c,v 1.23 2008/10/02 20:12:08 kurt Exp $ */ +/* $OpenBSD: sod.c,v 1.24 2012/06/12 20:32:17 matthew Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg @@ -132,6 +132,17 @@ backout: sodp->sod_name = (long)_dl_strdup(name); } +void +_dl_set_sod(const char *path, struct sod *sod) +{ + char *fname = _dl_strrchr(path, '/'); + + if (fname != NULL) + _dl_build_sod(++fname, sod); + else + _dl_build_sod(path, sod); +} + static struct hints_header *hheader = NULL; static struct hints_bucket *hbuckets; static char *hstrtab; |