git: 17fc43bc0101 - main - ldd: Remove non-functional -v option

Konstantin Belousov kib at FreeBSD.org
Sat Aug 28 20:39:24 UTC 2021


The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=17fc43bc01011ed05f614f266350d37f7020a59d

commit 17fc43bc01011ed05f614f266350d37f7020a59d
Author:     Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-08-28 17:28:54 +0000
Commit:     Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-08-28 20:39:16 +0000

    ldd: Remove non-functional -v option
    
    It seems -v only worked for a.out.  Remove it, not even keeping the current
    nop for compat.  Also remove more mentions of a.out format from the man
    page.
    
    Reviewed by:    dim, emaste
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D31708
---
 usr.bin/ldd/ldd.1 | 18 +-----------------
 usr.bin/ldd/ldd.c | 20 ++++++--------------
 2 files changed, 7 insertions(+), 31 deletions(-)

diff --git a/usr.bin/ldd/ldd.1 b/usr.bin/ldd/ldd.1
index 2a90d5ac537d..d263eabcf4ff 100644
--- a/usr.bin/ldd/ldd.1
+++ b/usr.bin/ldd/ldd.1
@@ -1,6 +1,6 @@
 .\" $FreeBSD$
 .\"
-.Dd October 23, 2018
+.Dd August 28, 2021
 .Dt LDD 1
 .Os
 .Sh NAME
@@ -9,7 +9,6 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl a
-.Op Fl v
 .Op Fl f Ar format
 .Ar program ...
 .Sh DESCRIPTION
@@ -47,16 +46,6 @@ The
 .Fl a
 option displays the list of all objects that are needed by each loaded
 object.
-This option does not work with
-.Xr a.out 5
-binaries.
-.Pp
-The
-.Fl v
-option displays a verbose listing of the dynamic linking headers
-encoded in the executable.
-See the source code and include
-files for the definitive meaning of all the fields.
 .Sh IMPLEMENTATION NOTES
 .Nm
 lists the dependencies of an executable by setting
@@ -82,8 +71,3 @@ A
 .Nm
 utility first appeared in SunOS 4.0, it appeared in its current form in
 .Fx 1.1 .
-.Pp
-The
-.Fl v
-support is based on code written by
-.An John Polstra Aq Mt jdp at polstra.com
diff --git a/usr.bin/ldd/ldd.c b/usr.bin/ldd/ldd.c
index f948b7312863..3353345d549d 100644
--- a/usr.bin/ldd/ldd.c
+++ b/usr.bin/ldd/ldd.c
@@ -83,7 +83,7 @@ static void	usage(void);
 #define	_PATH_LDD32	"/usr/bin/ldd32"
 
 static int
-execldd32(char *file, char *fmt1, char *fmt2, int aflag, int vflag)
+execldd32(char *file, char *fmt1, char *fmt2, int aflag)
 {
 	char *argv[9];
 	int i, rval, status;
@@ -94,8 +94,6 @@ execldd32(char *file, char *fmt1, char *fmt2, int aflag, int vflag)
 	argv[i++] = strdup(_PATH_LDD32);
 	if (aflag)
 		argv[i++] = strdup("-a");
-	if (vflag)
-		argv[i++] = strdup("-v");
 	if (fmt1 != NULL) {
 		argv[i++] = strdup("-f");
 		argv[i++] = strdup(fmt1);
@@ -136,12 +134,12 @@ int
 main(int argc, char *argv[])
 {
 	char *fmt1, *fmt2;
-	int rval, c, aflag, vflag;
+	int rval, c, aflag;
 
-	aflag = vflag = 0;
+	aflag = 0;
 	fmt1 = fmt2 = NULL;
 
-	while ((c = getopt(argc, argv, "af:v")) != -1) {
+	while ((c = getopt(argc, argv, "af:")) != -1) {
 		switch (c) {
 		case 'a':
 			aflag++;
@@ -154,9 +152,6 @@ main(int argc, char *argv[])
 			} else
 				fmt1 = optarg;
 			break;
-		case 'v':
-			vflag++;
-			break;
 		default:
 			usage();
 			/* NOTREACHED */
@@ -165,9 +160,6 @@ main(int argc, char *argv[])
 	argc -= optind;
 	argv += optind;
 
-	if (vflag && fmt1 != NULL)
-		errx(1, "-v may not be used with -f");
-
 	if (argc <= 0) {
 		usage();
 		/* NOTREACHED */
@@ -194,7 +186,7 @@ main(int argc, char *argv[])
 			break;
 #if __ELF_WORD_SIZE > 32 && defined(ELF32_SUPPORTED)
 		case TYPE_ELF32:
-			rval |= execldd32(*argv, fmt1, fmt2, aflag, vflag);
+			rval |= execldd32(*argv, fmt1, fmt2, aflag);
 			continue;
 #endif
 		case TYPE_UNKNOWN:
@@ -259,7 +251,7 @@ static void
 usage(void)
 {
 
-	fprintf(stderr, "usage: ldd [-a] [-v] [-f format] program ...\n");
+	fprintf(stderr, "usage: ldd [-a] [-f format] program ...\n");
 	exit(1);
 }
 


More information about the dev-commits-src-all mailing list