Add an -o option that behaves like nm -o. Implementation from a suggestion
by jmcneill (thanks!); ok mrg. Closes PR 41994.
This commit is contained in:
parent
cd5a3748ef
commit
15a88044ca
@ -1,4 +1,4 @@
|
|||||||
.\" $NetBSD: ldd.1,v 1.16 2009/08/23 15:37:39 wiz Exp $
|
.\" $NetBSD: ldd.1,v 1.17 2009/09/07 17:56:52 dholland Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
|
.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||||
.\" All rights reserved.
|
.\" All rights reserved.
|
||||||
@ -27,7 +27,7 @@
|
|||||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
.\" POSSIBILITY OF SUCH DAMAGE.
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
||||||
.\"
|
.\"
|
||||||
.Dd August 23, 2009
|
.Dd September 7, 2009
|
||||||
.Dt LDD 1
|
.Dt LDD 1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -35,6 +35,7 @@
|
|||||||
.Nd list dynamic object dependencies
|
.Nd list dynamic object dependencies
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm
|
.Nm
|
||||||
|
.Op Fl o
|
||||||
.Op Fl f Ar format
|
.Op Fl f Ar format
|
||||||
.Ar program ...
|
.Ar program ...
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
@ -93,6 +94,16 @@ Additionally,
|
|||||||
and
|
and
|
||||||
.Sy \et
|
.Sy \et
|
||||||
are recognized and have their usual meaning.
|
are recognized and have their usual meaning.
|
||||||
|
.Pp
|
||||||
|
The
|
||||||
|
.Fl o
|
||||||
|
option is an alias for
|
||||||
|
.Fl f
|
||||||
|
.Ar \&%a:-l\&%o.\&%m =\*[Gt] \&%p\en ,
|
||||||
|
which makes
|
||||||
|
.Nm
|
||||||
|
behave analogously to
|
||||||
|
.Ic nm Fl o .
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr ld 1 ,
|
.Xr ld 1 ,
|
||||||
.Xr ld.elf_so 1 ,
|
.Xr ld.elf_so 1 ,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: ldd.c,v 1.9 2009/08/22 06:52:16 mrg Exp $ */
|
/* $NetBSD: ldd.c,v 1.10 2009/09/07 17:56:52 dholland Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||||
@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
__RCSID("$NetBSD: ldd.c,v 1.9 2009/08/22 06:52:16 mrg Exp $");
|
__RCSID("$NetBSD: ldd.c,v 1.10 2009/09/07 17:56:52 dholland Exp $");
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -114,13 +114,13 @@ usage(void)
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *fmt1 = NULL, *fmt2 = NULL;
|
const char *fmt1 = NULL, *fmt2 = NULL;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
debug = 1;
|
debug = 1;
|
||||||
#endif
|
#endif
|
||||||
while ((c = getopt(argc, argv, "f:")) != -1) {
|
while ((c = getopt(argc, argv, "f:o")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'f':
|
case 'f':
|
||||||
if (fmt1) {
|
if (fmt1) {
|
||||||
@ -130,6 +130,11 @@ main(int argc, char **argv)
|
|||||||
} else
|
} else
|
||||||
fmt1 = optarg;
|
fmt1 = optarg;
|
||||||
break;
|
break;
|
||||||
|
case 'o':
|
||||||
|
if (fmt1 || fmt2)
|
||||||
|
errx(1, "Cannot use -o and -f together");
|
||||||
|
fmt1 = "%a:-l%o.%m => %p\n";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
|
Loading…
Reference in New Issue
Block a user