aboutsummaryrefslogtreecommitdiff
path: root/libexec/rtld-aout/shlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/rtld-aout/shlib.c')
-rw-r--r--libexec/rtld-aout/shlib.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/libexec/rtld-aout/shlib.c b/libexec/rtld-aout/shlib.c
index 55cd8c387c5a..64e2efc88846 100644
--- a/libexec/rtld-aout/shlib.c
+++ b/libexec/rtld-aout/shlib.c
@@ -1,5 +1,5 @@
/*
- * $Id: shlib.c,v 1.4 1993/11/08 13:21:23 pk Exp $
+ * $Id: shlib.c,v 1.2 1993/11/09 04:19:03 paul Exp $
*/
#include <sys/param.h>
@@ -132,9 +132,10 @@ int n1, n2;
#undef minor
char *
-findshlib(name, majorp, minorp)
+findshlib(name, majorp, minorp, do_dot_a)
char *name;
int *majorp, *minorp;
+int do_dot_a;
{
int dewey[MAXDEWEY];
int ndewey;
@@ -154,6 +155,7 @@ int *majorp, *minorp;
for (i = 0; i < n_search_dirs; i++) {
DIR *dd = opendir(search_dirs[i]);
struct dirent *dp;
+ int found_dot_a = 0;
if (dd == NULL)
continue;
@@ -161,6 +163,16 @@ int *majorp, *minorp;
while ((dp = readdir(dd)) != NULL) {
int n, j, might_take_it = 0;
+ if (do_dot_a && path == NULL &&
+ dp->d_namlen == len + 2 &&
+ strncmp(dp->d_name, lname, len) == 0 &&
+ (dp->d_name+len)[0] == '.' &&
+ (dp->d_name+len)[1] == 'a') {
+
+ path = concat(search_dirs[i], "/", dp->d_name);
+ found_dot_a = 1;
+ }
+
if (dp->d_namlen < len + 4)
continue;
if (strncmp(dp->d_name, lname, len) != 0)
@@ -171,6 +183,12 @@ int *majorp, *minorp;
if ((n = getdewey(tmp, dp->d_name+len+4)) == 0)
continue;
+ if (major != -1 && found_dot_a) { /* XXX */
+ free(path);
+ path = NULL;
+ found_dot_a = 0;
+ }
+
if (major == -1 && minor == -1) {
might_take_it = 1;
} else if (major != -1 && minor == -1) {
@@ -192,12 +210,19 @@ int *majorp, *minorp;
if (path)
free(path);
path = concat(search_dirs[i], "/", dp->d_name);
+ found_dot_a = 0;
bcopy(tmp, dewey, sizeof(dewey));
ndewey = n;
*majorp = dewey[0];
*minorp = dewey[1];
}
closedir(dd);
+
+ if (found_dot_a)
+ /*
+ * There's a .a archive here.
+ */
+ return path;
}
return path;