summaryrefslogtreecommitdiff
path: root/gnu/usr.bin
diff options
context:
space:
mode:
authorassar <assar@cvs.openbsd.org>2000-01-02 06:18:42 +0000
committerassar <assar@cvs.openbsd.org>2000-01-02 06:18:42 +0000
commit7804e65416d208dfe020b71145e8e2d30836f39d (patch)
tree17b629914b633464ac7d61c8ad024520f116fe9e /gnu/usr.bin
parent39450c70c106b50ef815c4b205729050df125361 (diff)
revert back 1.4->1.5.
ld (and ld.so) should take the shared library of the highest version in the first directory that it founds. this is the way ld/ld.so has traditionally worked since SunOS 4 and this is the way it should work. before changing this back - please make sure you understand the semantics of this and that you are not just hiding some other bug but toggling this change. also verify the example in the PR. see PR/972
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r--gnu/usr.bin/ld/shlib.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gnu/usr.bin/ld/shlib.c b/gnu/usr.bin/ld/shlib.c
index 2482f373d6b..1f47c7944ea 100644
--- a/gnu/usr.bin/ld/shlib.c
+++ b/gnu/usr.bin/ld/shlib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: shlib.c,v 1.5 1999/02/20 05:53:31 marc Exp $
+/* $OpenBSD: shlib.c,v 1.6 2000/01/02 06:18:41 assar Exp $ */
/* $NetBSD: shlib.c,v 1.13 1998/04/04 01:00:29 fvdl Exp $ */
/*
@@ -246,12 +246,14 @@ int do_dot_a;
DIR *dd = opendir(search_dirs[i]);
struct dirent *dp;
int found_dot_a = 0;
+ int might_take_it;
if (dd == NULL)
continue;
+ might_take_it = 0;
while ((dp = readdir(dd)) != NULL) {
- int n, might_take_it = 0;
+ int n;
if (do_dot_a && path == NULL &&
dp->d_namlen == len + 2 &&
@@ -308,9 +310,9 @@ int do_dot_a;
}
closedir(dd);
- if (found_dot_a)
+ if (found_dot_a || might_take_it)
/*
- * There's a .a archive here.
+ * There's a lib in this dir; take it.
*/
return path;
}