summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-aout/shlib.c
diff options
context:
space:
mode:
authorrich <rich@FreeBSD.org>1994-06-15 22:41:19 +0000
committerrich <rich@FreeBSD.org>1994-06-15 22:41:19 +0000
commitc2b2b846578d61b4bd2deae514c6669ba71a6b5d (patch)
treefc74fe81900a764f41153f6c45e592474d9cb257 /libexec/rtld-aout/shlib.c
parent24f89c1469242434ab6ab918657aa2085fad5ddc (diff)
downloadFreeBSD-src-c2b2b846578d61b4bd2deae514c6669ba71a6b5d.zip
FreeBSD-src-c2b2b846578d61b4bd2deae514c6669ba71a6b5d.tar.gz
Changes from Paul Kranenburg which bring us into sync with his sources:
handling of errors through the standard err() and warn() more fixes for Geoff Rehmet's NULL pointer bug. fixes NULL pointer bugs when linking mono and nested X servers. supports a `-nostdlib' option. accept object files without a symbol table don't attempt dynamic linking when `-A' is given a few variable names have chaged (desc -> fd), and the formatting has changed which should make it much easier to track his sources. I tested 'make world' for /usr/src and X twice with these changes.
Diffstat (limited to 'libexec/rtld-aout/shlib.c')
-rw-r--r--libexec/rtld-aout/shlib.c39
1 files changed, 25 insertions, 14 deletions
diff --git a/libexec/rtld-aout/shlib.c b/libexec/rtld-aout/shlib.c
index 38ec051..2e8dfe9 100644
--- a/libexec/rtld-aout/shlib.c
+++ b/libexec/rtld-aout/shlib.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: shlib.c,v 1.9 1994/01/29 02:03:15 jtc Exp $
+ * $Id: shlib.c,v 1.8 1994/02/13 20:41:43 jkh Exp $
*/
#include <sys/param.h>
@@ -37,6 +37,7 @@
#include <sys/stat.h>
#include <sys/file.h>
#include <sys/time.h>
+#include <err.h>
#include <fcntl.h>
#include <string.h>
#include <ctype.h>
@@ -53,7 +54,7 @@ char *strsep();
* Standard directories to search for files specified by -l.
*/
#ifndef STANDARD_SEARCH_DIRS
-#define STANDARD_SEARCH_DIRS "/usr/lib", "/usr/X386/lib", "/usr/local/lib"
+#define STANDARD_SEARCH_DIRS "/usr/lib", "/usr/X11R6/lib", "/usr/X386/lib", "/usr/local/lib"
#endif
/*
@@ -73,25 +74,32 @@ add_search_dir(name)
char *name;
{
n_search_dirs++;
- search_dirs = (char **)xrealloc(search_dirs,
- n_search_dirs * sizeof(char *));
+ search_dirs = (char **)
+ xrealloc(search_dirs, n_search_dirs * sizeof(char *));
search_dirs[n_search_dirs - 1] = strdup(name);
}
void
-std_search_dirs(paths)
-char *paths;
+add_search_path(path)
+char *path;
{
- char *cp;
- int i, n;
+ register char *cp;
+
+ if (path == NULL)
+ return;
- if (paths != NULL)
/* Add search directories from `paths' */
- while ((cp = strsep(&paths, ":")) != NULL) {
+ while ((cp = strsep(&path, ":")) != NULL) {
add_search_dir(cp);
- if (paths)
- *(paths-1) = ':';
+ if (path)
+ *(path-1) = ':';
}
+}
+
+void
+std_search_path()
+{
+ int i, n;
/* Append standard search directories */
n = sizeof standard_search_dirs / sizeof standard_search_dirs[0];
@@ -137,7 +145,7 @@ cmpndewey(d1, n1, d2, n2)
int d1[], d2[];
int n1, n2;
{
- int i;
+ register int i;
for (i = 0; i < n1 && i < n2; i++) {
if (d1[i] < d2[i])
@@ -154,6 +162,9 @@ int n1, n2;
if (i == n2)
return 1;
+
+ errx(1, "cmpndewey: cant happen");
+ return 0;
}
/*
@@ -200,7 +211,7 @@ int do_dot_a;
continue;
while ((dp = readdir(dd)) != NULL) {
- int n, j, might_take_it = 0;
+ int n, might_take_it = 0;
if (do_dot_a && path == NULL &&
dp->d_namlen == len + 2 &&
OpenPOWER on IntegriCloud