diff options
-rw-r--r-- | gnu/libexec/ld.so/ldconfig/ldconfig.c | 4 | ||||
-rw-r--r-- | gnu/libexec/ld.so/ldd/ldd.c | 22 |
2 files changed, 17 insertions, 9 deletions
diff --git a/gnu/libexec/ld.so/ldconfig/ldconfig.c b/gnu/libexec/ld.so/ldconfig/ldconfig.c index e8e2cd77434..ef2ce5be8ec 100644 --- a/gnu/libexec/ld.so/ldconfig/ldconfig.c +++ b/gnu/libexec/ld.so/ldconfig/ldconfig.c @@ -383,7 +383,7 @@ int main(int argc, char **argv) prog = argv[0]; opterr = 0; - while ((c = getopt(argc, argv, "DvnNXlpf:P:")) != EOF) + while ((c = getopt(argc, argv, "DvnNXlpf:P:m:")) != EOF) switch (c) { case 'D': @@ -408,6 +408,8 @@ int main(int argc, char **argv) case 'l': libmode = 1; /* library mode */ break; + case 'm': /* Compatibility hack */ + break; case 'p': printcache = 1; /* print cache */ break; diff --git a/gnu/libexec/ld.so/ldd/ldd.c b/gnu/libexec/ld.so/ldd/ldd.c index d26471c58fe..6cb11b2b6a3 100644 --- a/gnu/libexec/ld.so/ldd/ldd.c +++ b/gnu/libexec/ld.so/ldd/ldd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldd.c,v 1.1 1996/10/04 21:27:05 pefo Exp $ */ +/* $OpenBSD: ldd.c,v 1.2 1998/01/28 10:52:45 pefo Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -42,7 +42,7 @@ #include <sys/mman.h> #include <elf_abi.h> -int readsoneeded(FILE *); +int readsoneeded(FILE *f, int flag); main(argc, argv) int argc; @@ -70,22 +70,25 @@ main(argc, argv) fprintf(stderr, "%s: can't find '%s'.\n", argv[0], argv[i]); exit(2); } - if(!lflag) - readsoneeded(f); - fclose(f); + if(!lflag) { + readsoneeded(f, 0); + fclose(f); + } - if(lflag) { + else if(lflag && readsoneeded(f, 1)) { + fclose(f); setenv("LD_TRACE_LOADED_OBJECTS", "1", 1); execl(argv[i], NULL); } exit(0); } -int readsoneeded(FILE *infile) +int readsoneeded(FILE *infile, int dyncheck) { Elf32_Ehdr *epnt; Elf32_Phdr *ppnt; int i; + int isdynamic = 0; char *header; unsigned int dynamic_addr = 0; unsigned int dynamic_size = 0; @@ -148,6 +151,9 @@ int readsoneeded(FILE *infile) while(dpnt->d_tag != DT_NULL) { if (dpnt->d_tag == DT_NEEDED) { + isdynamic = 1; + if(dyncheck) + break; soname_val = dpnt->d_un.d_val; if (soname_val != 0 && soname_val + strtab_val - loadbase >= 0 && soname_val + strtab_val - loadbase < st.st_size) @@ -159,6 +165,6 @@ int readsoneeded(FILE *infile) skip: munmap(header, st.st_size); - return 0; + return isdynamic; } |