diff options
author | peter <peter@FreeBSD.org> | 1996-10-01 02:16:16 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1996-10-01 02:16:16 +0000 |
commit | 519e9b0911db8a2c11a96565cdaf9726957e36f8 (patch) | |
tree | 4a1ee76d65283f0bc07bcd87034f55b5f0a43ffc /usr.bin/ldd/ldd.c | |
parent | 7523d23ee7b9610928e383200f010b495d600ed5 (diff) | |
download | FreeBSD-src-519e9b0911db8a2c11a96565cdaf9726957e36f8.zip FreeBSD-src-519e9b0911db8a2c11a96565cdaf9726957e36f8.tar.gz |
Incorporate John Polstra's sods.c display of the details about the
dynamic linking information in the executable. It's quite extensive.
It's connected to ldd's (new) -v option.
Diffstat (limited to 'usr.bin/ldd/ldd.c')
-rw-r--r-- | usr.bin/ldd/ldd.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/usr.bin/ldd/ldd.c b/usr.bin/ldd/ldd.c index 79a229b..841baf8 100644 --- a/usr.bin/ldd/ldd.c +++ b/usr.bin/ldd/ldd.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: ldd.c,v 1.5 1994/12/23 22:31:31 nate Exp $ + * $Id: ldd.c,v 1.6 1996/10/01 01:34:32 peter Exp $ */ #include <sys/types.h> @@ -44,6 +44,9 @@ #include <string.h> #include <unistd.h> +extern void dump_filename __P((const char *)); +extern int error_count; + void usage() { @@ -61,9 +64,13 @@ char *argv[]; char *fmt1 = NULL, *fmt2 = NULL; int rval; int c; + int vflag; - while ((c = getopt(argc, argv, "f:")) != EOF) { + while ((c = getopt(argc, argv, "vf:")) != EOF) { switch (c) { + case 'v': + vflag++; + break; case 'f': if (fmt1) { if (fmt2) @@ -80,11 +87,20 @@ char *argv[]; argc -= optind; argv += optind; + if (vflag && fmt1) + errx(1, "-v may not be used with -f"); + if (argc <= 0) { usage(); /*NOTREACHED*/ } + if (vflag) { + for (c = 0; c < argc; c++) + dump_file(argv[c]); + exit(error_count == 0 ? EXIT_SUCCESS : EXIT_FAILURE); + } + /* ld.so magic */ setenv("LD_TRACE_LOADED_OBJECTS", "", 1); if (fmt1) |