diff options
author | joerg <joerg@FreeBSD.org> | 1995-01-12 19:12:29 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1995-01-12 19:12:29 +0000 |
commit | 0cd8c74ee0e434aa440be03bc3adf1bc2943510f (patch) | |
tree | 78644d2a781b7616e0bddf5deaea7a146fc257b3 /libexec/rtld-aout | |
parent | 64a49cb518c9c8d2515f5cb42d5361d327bfeb17 (diff) | |
download | FreeBSD-src-0cd8c74ee0e434aa440be03bc3adf1bc2943510f.zip FreeBSD-src-0cd8c74ee0e434aa440be03bc3adf1bc2943510f.tar.gz |
Make ldconfig and ld.so not hashing the shared lib minor number. This
misfeature caused troubles when a program attempted to access a shlib
where one with a higher minor number has been hashed. Ldconfig does
only include the highest-numbered shlib anyway, so this is in no way a
limitation of generality.
Caution: after installing the new programs, your /var/run/ld.so.hints
needs to be rebuiult; run ldconfig again as it's done from /etc/rc.
Diffstat (limited to 'libexec/rtld-aout')
-rw-r--r-- | libexec/rtld-aout/rtld.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libexec/rtld-aout/rtld.c b/libexec/rtld-aout/rtld.c index 2c31434..2448f87 100644 --- a/libexec/rtld-aout/rtld.c +++ b/libexec/rtld-aout/rtld.c @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: rtld.c,v 1.18 1994/09/15 20:48:55 bde Exp $ + * $Id: rtld.c,v 1.19 1994/12/23 22:31:35 nate Exp $ */ #include <sys/param.h> @@ -1024,9 +1024,9 @@ unmaphints() } int -hinthash(cp, vmajor, vminor) +hinthash(cp, vmajor) char *cp; - int vmajor, vminor; + int vmajor; { int k = 0; @@ -1034,7 +1034,6 @@ hinthash(cp, vmajor, vminor) k = (((k << 1) + (k >> 14)) ^ (*cp++)) & 0x3fff; k = (((k << 1) + (k >> 14)) ^ (vmajor*257)) & 0x3fff; - k = (((k << 1) + (k >> 14)) ^ (vminor*167)) & 0x3fff; return k; } @@ -1050,7 +1049,7 @@ findhint(name, major, minor, preferred_path) { struct hints_bucket *bp; - bp = hbuckets + (hinthash(name, major, minor) % hheader->hh_nbucket); + bp = hbuckets + (hinthash(name, major) % hheader->hh_nbucket); while (1) { /* Sanity check */ @@ -1066,7 +1065,7 @@ findhint(name, major, minor, preferred_path) if (strcmp(name, hstrtab + bp->hi_namex) == 0) { /* It's `name', check version numbers */ if (bp->hi_major == major && - (bp->hi_ndewey < 2 || bp->hi_minor == minor)) { + (bp->hi_ndewey < 2 || bp->hi_minor >= minor)) { if (preferred_path == NULL || strcmp(preferred_path, hstrtab + bp->hi_pathx) == 0) { |