Download raw body.
ldd(1): remove unimplemented -x option
On January 6, 2026 4:13:12 PM GMT+01:00, Alexander Farber <alexander.farber@gmail.com> wrote:
>Hi,
>
>ldd(1) accepts -x but immediately errors with "not yet implemented".
>This stub has been in place for over 10 years and neither FreeBSD nor
>NetBSD have this option. The man page already has -x commented out.
>This removes the dead code.
This would break `ldd -- progname`, no? So the code removed is not quite dead.
/Alexander
>
>ok?
>
>Index: src/libexec/ld.so/ldd/ldd.c
>===================================================================
>RCS file: /cvs/src/libexec/ld.so/ldd/ldd.c,v
>retrieving revision 1.26
>diff -u -r1.26 ldd.c
>--- src/libexec/ld.so/ldd/ldd.c 15 Aug 2023 13:50:53 -0000 1.26
>+++ src/libexec/ld.so/ldd/ldd.c 6 Jan 2026 14:31:33 -0000
>@@ -46,28 +46,13 @@
> int
> main(int argc, char **argv)
> {
>- int c, xflag, ret;
>+ int ret;
>
> if (pledge("stdio rpath proc exec prot_exec", NULL) == -1)
> err(1, "pledge");
>
>- xflag = 0;
>- while ((c = getopt(argc, argv, "x")) != -1) {
>- switch (c) {
>- case 'x':
>- xflag = 1;
>- break;
>- default:
>- usage();
>- /*NOTREACHED*/
>- }
>- }
>-
>- if (xflag)
>- errx(1, "-x not yet implemented");
>-
>- argc -= optind;
>- argv += optind;
>+ argc--;
>+ argv++;
>
> if (argc == 0)
> usage();
ldd(1): remove unimplemented -x option