CVS commit: src/usr.bin/ldd

2021-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jul 23 04:20:05 UTC 2021

Modified Files:
src/usr.bin/ldd: ldd.c

Log Message:
gcc hates strncpy()


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/ldd/ldd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/ldd.c
diff -u src/usr.bin/ldd/ldd.c:1.24 src/usr.bin/ldd/ldd.c:1.25
--- src/usr.bin/ldd/ldd.c:1.24	Thu Jul 22 17:39:52 2021
+++ src/usr.bin/ldd/ldd.c	Fri Jul 23 04:20:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.c,v 1.24 2021/07/22 17:39:52 christos Exp $	*/
+/*	$NetBSD: ldd.c,v 1.25 2021/07/23 04:20:05 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ldd.c,v 1.24 2021/07/22 17:39:52 christos Exp $");
+__RCSID("$NetBSD: ldd.c,v 1.25 2021/07/23 04:20:05 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -161,10 +161,13 @@ main(int argc, char **argv)
 	for (; argc != 0; argc--, argv++) {
 		int fd;
 
-		if (**argv != '/')
-			snprintf(path, sizeof(path), "%s/%s", cwd, *argv);
-		else
+		if (**argv != '/') {
+			strcpy(path, cwd);
+			strlcat(path, "/", sizeof(path));
+			strlcat(path, *argv, sizeof(path));
+		} else {
 			strlcpy(path, *argv, sizeof(path));
+		}
 		fd = open(*argv, O_RDONLY);
 		if (fd == -1) {
 			exit_status = EXIT_FAILURE;



CVS commit: src/usr.bin/ldd

2021-07-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul 22 17:39:53 UTC 2021

Modified Files:
src/usr.bin/ldd: ldd.c ldd.h ldd_elfxx.c

Log Message:
rtld expects an absolute path in execname provided via AUXV in order to
handle $ORIGIN properly and checks for that. Since we are calling its guts
directly, provide one.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/ldd/ldd.c
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/ldd/ldd.h src/usr.bin/ldd/ldd_elfxx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/ldd.c
diff -u src/usr.bin/ldd/ldd.c:1.23 src/usr.bin/ldd/ldd.c:1.24
--- src/usr.bin/ldd/ldd.c:1.23	Mon Dec 25 00:08:49 2017
+++ src/usr.bin/ldd/ldd.c	Thu Jul 22 13:39:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.c,v 1.23 2017/12/25 05:08:49 maya Exp $	*/
+/*	$NetBSD: ldd.c,v 1.24 2021/07/22 17:39:52 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ldd.c,v 1.23 2017/12/25 05:08:49 maya Exp $");
+__RCSID("$NetBSD: ldd.c,v 1.24 2021/07/22 17:39:52 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -123,6 +123,7 @@ main(int argc, char **argv)
 {
 	const char *fmt1 = NULL, *fmt2 = NULL;
 	int c, exit_status = EXIT_SUCCESS;
+	char cwd[MAXPATHLEN], path[MAXPATHLEN];
 
 #ifdef DEBUG
 	debug = 1;
@@ -154,22 +155,28 @@ main(int argc, char **argv)
 		usage();
 		/*NOTREACHED*/
 	}
+	if (getcwd(cwd, sizeof(cwd)) == NULL)
+		err(EXIT_FAILURE, "Can't get working directory");
 
 	for (; argc != 0; argc--, argv++) {
 		int fd;
 
+		if (**argv != '/')
+			snprintf(path, sizeof(path), "%s/%s", cwd, *argv);
+		else
+			strlcpy(path, *argv, sizeof(path));
 		fd = open(*argv, O_RDONLY);
 		if (fd == -1) {
 			exit_status = EXIT_FAILURE;
 			warn("%s", *argv);
 			continue;
 		}
-		if (elf_ldd(fd, *argv, fmt1, fmt2) == -1
+		if (elf_ldd(fd, *argv, path, fmt1, fmt2) == -1
 		/* Alpha never had 32 bit support. */
 #if (defined(_LP64) && !defined(ELF64_ONLY)) || defined(MIPS_N32)
-		&& elf32_ldd(fd, *argv, fmt1, fmt2) == -1
+		&& elf32_ldd(fd, *argv, path, fmt1, fmt2) == -1
 #if defined(__mips__) && 0 /* XXX this is still hosed for some reason */
-		&& elf32_ldd_compat(fd, *argv, fmt1, fmt2) == -1
+		&& elf32_ldd_compat(fd, *argv, path, fmt1, fmt2) == -1
 #endif
 #endif
 		) {

Index: src/usr.bin/ldd/ldd.h
diff -u src/usr.bin/ldd/ldd.h:1.7 src/usr.bin/ldd/ldd.h:1.8
--- src/usr.bin/ldd/ldd.h:1.7	Sat Jul  7 20:53:44 2012
+++ src/usr.bin/ldd/ldd.h	Thu Jul 22 13:39:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.h,v 1.7 2012/07/08 00:53:44 matt Exp $	*/
+/*	$NetBSD: ldd.h,v 1.8 2021/07/22 17:39:53 christos Exp $	*/
 
 /*
  * Copyright (c) 2008 Matthew R. Green
@@ -28,14 +28,14 @@
  * SUCH DAMAGE.
  */
 
-int elf32_ldd(int, char *, const char *, const char *);
+int elf32_ldd(int, char *, char *, const char *, const char *);
 
 #ifdef _LP64
 #define LDD_ELF64
 #endif
 
 #ifdef LDD_ELF64
-int elf64_ldd(int, char *, const char *, const char *);
+int elf64_ldd(int, char *, char *, const char *, const char *);
 #define elf_ldd elf64_ldd
 #elif defined(ELF32_COMPAT)
 #define elf_ldd elf32_compat_ldd
Index: src/usr.bin/ldd/ldd_elfxx.c
diff -u src/usr.bin/ldd/ldd_elfxx.c:1.7 src/usr.bin/ldd/ldd_elfxx.c:1.8
--- src/usr.bin/ldd/ldd_elfxx.c:1.7	Tue Jan 10 16:11:25 2017
+++ src/usr.bin/ldd/ldd_elfxx.c	Thu Jul 22 13:39:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd_elfxx.c,v 1.7 2017/01/10 21:11:25 christos Exp $	*/
+/*	$NetBSD: ldd_elfxx.c,v 1.8 2021/07/22 17:39:53 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ldd_elfxx.c,v 1.7 2017/01/10 21:11:25 christos Exp $");
+__RCSID("$NetBSD: ldd_elfxx.c,v 1.8 2021/07/22 17:39:53 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -93,7 +93,7 @@ static void fmtprint(const char *, Obj_E
  * returns 0 on success and -1 on failure.
  */
 int
-ELFNAME(ldd)(int fd, char *path, const char *fmt1, const char *fmt2)
+ELFNAME(ldd)(int fd, char *prog, char *path, const char *fmt1, const char *fmt2)
 {
 	struct stat st;
 
@@ -132,7 +132,7 @@ ELFNAME(ldd)(int fd, char *path, const c
 	(void) _rtld_load_needed_objects(_rtld_objmain, 0);
 
 	if (fmt1 == NULL)
-		printf("%s:\n", _rtld_objmain->path);
+		printf("%s:\n", prog);
 	main_local = path;
 	main_progname = _rtld_objmain->path;
 	print_needed(_rtld_objmain, fmt1, fmt2);



CVS commit: src/usr.bin/ldd

2021-04-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 25 23:52:59 UTC 2021

Modified Files:
src/usr.bin/ldd: Makefile.inc
src/usr.bin/ldd/build: Makefile
src/usr.bin/ldd/elf64: Makefile

Log Message:
Handle mipsn64


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/ldd/Makefile.inc
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/ldd/build/Makefile
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/ldd/elf64/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/Makefile.inc
diff -u src/usr.bin/ldd/Makefile.inc:1.7 src/usr.bin/ldd/Makefile.inc:1.8
--- src/usr.bin/ldd/Makefile.inc:1.7	Sat Jan 23 16:22:49 2016
+++ src/usr.bin/ldd/Makefile.inc	Sun Apr 25 19:52:59 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.7 2016/01/23 21:22:49 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.8 2021/04/25 23:52:59 christos Exp $
 
 WARNS?=	3	# XXX: -Wsign-compare issues ld.elf_so source
 
@@ -16,12 +16,19 @@ MLIBDIR=	i386
 MLIBDIR=	powerpc
 .endif
 
+.if !empty(MACHINE_ARCH:Mmips64*)
 # For now make "elf32" look for native (n32)
-.if (${MACHINE_ARCH} == "mips64eb") || (${MACHINE_ARCH} == "mips64el")
 MLIBDIR=	64
 COMPAT_MLIBDIR=	o32
 CPPFLAGS+= -DLDD_ELF64 -DMIPS_N32
 .endif
+
+.if !empty(MACHINE_ARCH:Mmipsn64*)
+MLIBDIR=	n32
+COMPAT_MLIBDIR=	o32
+CPPFLAGS+= -DMIPS_N32
+.endif
+
 CPPFLAGS+=	-D_KERNTYPES
 
 .endif	# MKCOMPAT

Index: src/usr.bin/ldd/build/Makefile
diff -u src/usr.bin/ldd/build/Makefile:1.6 src/usr.bin/ldd/build/Makefile:1.7
--- src/usr.bin/ldd/build/Makefile:1.6	Sun Feb  3 19:05:20 2019
+++ src/usr.bin/ldd/build/Makefile	Sun Apr 25 19:52:59 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2019/02/04 00:05:20 mrg Exp $
+#	$NetBSD: Makefile,v 1.7 2021/04/25 23:52:59 christos Exp $
 
 NOSANITIZER=		# defined
 
@@ -18,7 +18,7 @@ CPPFLAGS.ldd.c+= -DELF64_ONLY
 .endif
 
 .if ${MKCOMPAT} != "no"
-. if (${MACHINE_ARCH} == "mips64el") || (${MACHINE_ARCH} == "mips64eb")
+. if ${MACHINE_MIPS64}
 LIB_ELF32COMPATDIR!=	cd ${.CURDIR}/../elf32_compat && ${PRINTOBJDIR}
 EXTRA_LIBS+=		${LIB_ELF32COMPATDIR}/libldd_elf32_compat.a
 . endif

Index: src/usr.bin/ldd/elf64/Makefile
diff -u src/usr.bin/ldd/elf64/Makefile:1.12 src/usr.bin/ldd/elf64/Makefile:1.13
--- src/usr.bin/ldd/elf64/Makefile:1.12	Sun Feb  3 19:05:20 2019
+++ src/usr.bin/ldd/elf64/Makefile	Sun Apr 25 19:52:59 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.12 2019/02/04 00:05:20 mrg Exp $
+#	$NetBSD: Makefile,v 1.13 2021/04/25 23:52:59 christos Exp $
 
 NOSANITIZER=		# defined
 
@@ -41,7 +41,7 @@ CPPFLAGS+=	-D${_d}=_elf64_${_d}
 .endfor
 
 .if ${MKCOMPAT} != "no"
-. if (${MACHINE_ARCH} == "mips64el") || (${MACHINE_ARCH} == "mips64eb")
+. if ${MACHINE_MIPS64}
 CPPFLAGS+=	-DRTLD_ARCH_SUBDIR=\"${MLIBDIR}\"
 . endif
 .endif



CVS commit: src/usr.bin/ldd

2019-02-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Feb  4 00:05:21 UTC 2019

Modified Files:
src/usr.bin/ldd/build: Makefile
src/usr.bin/ldd/elf64: Makefile

Log Message:
don't build ldd64 support if !MKCOMPAT and mips64.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/ldd/build/Makefile
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/ldd/elf64/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/build/Makefile
diff -u src/usr.bin/ldd/build/Makefile:1.5 src/usr.bin/ldd/build/Makefile:1.6
--- src/usr.bin/ldd/build/Makefile:1.5	Sun Jan 27 05:17:48 2019
+++ src/usr.bin/ldd/build/Makefile	Mon Feb  4 00:05:20 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2019/01/27 05:17:48 kre Exp $
+#	$NetBSD: Makefile,v 1.6 2019/02/04 00:05:20 mrg Exp $
 
 NOSANITIZER=		# defined
 
@@ -17,9 +17,11 @@ EXTRA_LIBS+=	${LIB_ELF32DIR}/libldd_elf3
 CPPFLAGS.ldd.c+= -DELF64_ONLY
 .endif
 
-.if (${MACHINE_ARCH} == "mips64el") || (${MACHINE_ARCH} == "mips64eb")
+.if ${MKCOMPAT} != "no"
+. if (${MACHINE_ARCH} == "mips64el") || (${MACHINE_ARCH} == "mips64eb")
 LIB_ELF32COMPATDIR!=	cd ${.CURDIR}/../elf32_compat && ${PRINTOBJDIR}
 EXTRA_LIBS+=		${LIB_ELF32COMPATDIR}/libldd_elf32_compat.a
+. endif
 .endif
 
 .if ${OBJECT_FMTS:Melf64} != ""

Index: src/usr.bin/ldd/elf64/Makefile
diff -u src/usr.bin/ldd/elf64/Makefile:1.11 src/usr.bin/ldd/elf64/Makefile:1.12
--- src/usr.bin/ldd/elf64/Makefile:1.11	Sun Jan 27 05:14:45 2019
+++ src/usr.bin/ldd/elf64/Makefile	Mon Feb  4 00:05:20 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2019/01/27 05:14:45 kre Exp $
+#	$NetBSD: Makefile,v 1.12 2019/02/04 00:05:20 mrg Exp $
 
 NOSANITIZER=		# defined
 
@@ -40,8 +40,10 @@ RTLD_FUNCS	= \
 CPPFLAGS+=	-D${_d}=_elf64_${_d}
 .endfor
 
-.if (${MACHINE_ARCH} == "mips64el") || (${MACHINE_ARCH} == "mips64eb")
+.if ${MKCOMPAT} != "no"
+. if (${MACHINE_ARCH} == "mips64el") || (${MACHINE_ARCH} == "mips64eb")
 CPPFLAGS+=	-DRTLD_ARCH_SUBDIR=\"${MLIBDIR}\"
+. endif
 .endif
 
 .include "../Makefile.elf"



CVS commit: src/usr.bin/ldd/build

2019-01-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jan 27 05:17:48 UTC 2019

Modified Files:
src/usr.bin/ldd/build: Makefile

Log Message:
Fix merge botch


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/ldd/build/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/build/Makefile
diff -u src/usr.bin/ldd/build/Makefile:1.4 src/usr.bin/ldd/build/Makefile:1.5
--- src/usr.bin/ldd/build/Makefile:1.4	Sun Jan 27 02:08:50 2019
+++ src/usr.bin/ldd/build/Makefile	Sun Jan 27 05:17:48 2019
@@ -1,6 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2019/01/27 02:08:50 pgoyette Exp $
-
-NOSANITIZER=		# defined
+#	$NetBSD: Makefile,v 1.5 2019/01/27 05:17:48 kre Exp $
 
 NOSANITIZER=		# defined
 



CVS commit: src/usr.bin/ldd/elf32

2019-01-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jan 27 05:16:55 UTC 2019

Modified Files:
src/usr.bin/ldd/elf32: Makefile

Log Message:
Fix merge botch


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/ldd/elf32/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/elf32/Makefile
diff -u src/usr.bin/ldd/elf32/Makefile:1.11 src/usr.bin/ldd/elf32/Makefile:1.12
--- src/usr.bin/ldd/elf32/Makefile:1.11	Sun Jan 27 02:08:50 2019
+++ src/usr.bin/ldd/elf32/Makefile	Sun Jan 27 05:16:55 2019
@@ -1,6 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2019/01/27 02:08:50 pgoyette Exp $
-
-NOSANITIZER=		# defined
+#	$NetBSD: Makefile,v 1.12 2019/01/27 05:16:55 kre Exp $
 
 NOSANITIZER=		# defined
 



CVS commit: src/usr.bin/ldd/elf32_compat

2019-01-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jan 27 05:15:42 UTC 2019

Modified Files:
src/usr.bin/ldd/elf32_compat: Makefile

Log Message:
Fix merge botch


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/ldd/elf32_compat/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/elf32_compat/Makefile
diff -u src/usr.bin/ldd/elf32_compat/Makefile:1.3 src/usr.bin/ldd/elf32_compat/Makefile:1.4
--- src/usr.bin/ldd/elf32_compat/Makefile:1.3	Sun Jan 27 02:08:51 2019
+++ src/usr.bin/ldd/elf32_compat/Makefile	Sun Jan 27 05:15:42 2019
@@ -1,6 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2019/01/27 02:08:51 pgoyette Exp $
-
-NOSANITIZER=		# defined
+#	$NetBSD: Makefile,v 1.4 2019/01/27 05:15:42 kre Exp $
 
 NOSANITIZER=		# defined
 



CVS commit: src/usr.bin/ldd/elf64

2019-01-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jan 27 05:14:45 UTC 2019

Modified Files:
src/usr.bin/ldd/elf64: Makefile

Log Message:
Fix merge botch


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/ldd/elf64/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/elf64/Makefile
diff -u src/usr.bin/ldd/elf64/Makefile:1.10 src/usr.bin/ldd/elf64/Makefile:1.11
--- src/usr.bin/ldd/elf64/Makefile:1.10	Sun Jan 27 02:08:51 2019
+++ src/usr.bin/ldd/elf64/Makefile	Sun Jan 27 05:14:45 2019
@@ -1,6 +1,4 @@
-#	$NetBSD: Makefile,v 1.10 2019/01/27 02:08:51 pgoyette Exp $
-
-NOSANITIZER=		# defined
+#	$NetBSD: Makefile,v 1.11 2019/01/27 05:14:45 kre Exp $
 
 NOSANITIZER=		# defined
 



CVS commit: src/usr.bin/ldd

2018-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 10:41:46 UTC 2018

Modified Files:
src/usr.bin/ldd/build: Makefile
src/usr.bin/ldd/elf32: Makefile
src/usr.bin/ldd/elf32_compat: Makefile
src/usr.bin/ldd/elf64: Makefile

Log Message:
Disable SANITIZER for ldd(1)

These utilities (elf32, elf32_compat, elf64, liblldb) share code with the
ELF dynamic loader that is not being sanitized and its symbols are
installed into sanitized programs (in particular __tls_get_addr()).

Additionally libldd is used in rescue that is not expected to be sanitized
as of today.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/ldd/build/Makefile
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/ldd/elf32/Makefile
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/ldd/elf32_compat/Makefile
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/ldd/elf64/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/build/Makefile
diff -u src/usr.bin/ldd/build/Makefile:1.2 src/usr.bin/ldd/build/Makefile:1.3
--- src/usr.bin/ldd/build/Makefile:1.2	Sun Mar  2 03:55:19 2014
+++ src/usr.bin/ldd/build/Makefile	Thu Jun 21 10:41:45 2018
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.2 2014/03/02 03:55:19 matt Exp $
+#	$NetBSD: Makefile,v 1.3 2018/06/21 10:41:45 kamil Exp $
+
+NOSANITIZER=		# defined
 
 .include 		# for MKDYNAMICROOT definition
 

Index: src/usr.bin/ldd/elf32/Makefile
diff -u src/usr.bin/ldd/elf32/Makefile:1.9 src/usr.bin/ldd/elf32/Makefile:1.10
--- src/usr.bin/ldd/elf32/Makefile:1.9	Sun Mar  2 03:55:19 2014
+++ src/usr.bin/ldd/elf32/Makefile	Thu Jun 21 10:41:46 2018
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.9 2014/03/02 03:55:19 matt Exp $
+#	$NetBSD: Makefile,v 1.10 2018/06/21 10:41:46 kamil Exp $
+
+NOSANITIZER=		# defined
 
 .include 
 .include 

Index: src/usr.bin/ldd/elf32_compat/Makefile
diff -u src/usr.bin/ldd/elf32_compat/Makefile:1.1 src/usr.bin/ldd/elf32_compat/Makefile:1.2
--- src/usr.bin/ldd/elf32_compat/Makefile:1.1	Sun Dec 13 08:50:56 2009
+++ src/usr.bin/ldd/elf32_compat/Makefile	Thu Jun 21 10:41:46 2018
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.1 2009/12/13 08:50:56 mrg Exp $
+#	$NetBSD: Makefile,v 1.2 2018/06/21 10:41:46 kamil Exp $
+
+NOSANITIZER=		# defined
 
 .include 
 .include 

Index: src/usr.bin/ldd/elf64/Makefile
diff -u src/usr.bin/ldd/elf64/Makefile:1.8 src/usr.bin/ldd/elf64/Makefile:1.9
--- src/usr.bin/ldd/elf64/Makefile:1.8	Thu Aug 28 12:23:29 2014
+++ src/usr.bin/ldd/elf64/Makefile	Thu Jun 21 10:41:46 2018
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile,v 1.8 2014/08/28 12:23:29 joerg Exp $
+#	$NetBSD: Makefile,v 1.9 2018/06/21 10:41:46 kamil Exp $
+
+NOSANITIZER=		# defined
 
 .include 
 



CVS commit: src/usr.bin/ldd

2017-12-24 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Dec 25 05:08:49 UTC 2017

Modified Files:
src/usr.bin/ldd: ldd.1 ldd.c

Log Message:
Return a non-zero (one) exit code on failure for one of the files

But keep on processing them, like ls, rm, and other programs do


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/ldd/ldd.1
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/ldd/ldd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/ldd.1
diff -u src/usr.bin/ldd/ldd.1:1.19 src/usr.bin/ldd/ldd.1:1.20
--- src/usr.bin/ldd/ldd.1:1.19	Mon Jul  3 21:34:19 2017
+++ src/usr.bin/ldd/ldd.1	Mon Dec 25 05:08:49 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ldd.1,v 1.19 2017/07/03 21:34:19 wiz Exp $
+.\"	$NetBSD: ldd.1,v 1.20 2017/12/25 05:08:49 maya Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 7, 2009
+.Dd December 25, 2017
 .Dt LDD 1
 .Os
 .Sh NAME
@@ -105,6 +105,8 @@ which makes
 .Nm
 behave analogously to
 .Ic nm Fl o .
+.Sh EXIT STATUS
+.Ex -std
 .Sh SEE ALSO
 .Xr ld 1 ,
 .Xr ld.elf_so 1 ,

Index: src/usr.bin/ldd/ldd.c
diff -u src/usr.bin/ldd/ldd.c:1.22 src/usr.bin/ldd/ldd.c:1.23
--- src/usr.bin/ldd/ldd.c:1.22	Sun Mar  2 03:55:19 2014
+++ src/usr.bin/ldd/ldd.c	Mon Dec 25 05:08:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.c,v 1.22 2014/03/02 03:55:19 matt Exp $	*/
+/*	$NetBSD: ldd.c,v 1.23 2017/12/25 05:08:49 maya Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ldd.c,v 1.22 2014/03/02 03:55:19 matt Exp $");
+__RCSID("$NetBSD: ldd.c,v 1.23 2017/12/25 05:08:49 maya Exp $");
 #endif /* not lint */
 
 #include 
@@ -122,7 +122,7 @@ int
 main(int argc, char **argv)
 {
 	const char *fmt1 = NULL, *fmt2 = NULL;
-	int c;
+	int c, exit_status = EXIT_SUCCESS;
 
 #ifdef DEBUG
 	debug = 1;
@@ -160,6 +160,7 @@ main(int argc, char **argv)
 
 		fd = open(*argv, O_RDONLY);
 		if (fd == -1) {
+			exit_status = EXIT_FAILURE;
 			warn("%s", *argv);
 			continue;
 		}
@@ -171,12 +172,14 @@ main(int argc, char **argv)
 		&& elf32_ldd_compat(fd, *argv, fmt1, fmt2) == -1
 #endif
 #endif
-		)
+		) {
+			exit_status = EXIT_FAILURE;
 			warnx("%s", error_message);
+		}
 		close(fd);
 	}
 
-	return 0;
+	return exit_status;
 }
 
 /*



CVS commit: src/usr.bin/ldd

2017-01-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 10 21:11:25 UTC 2017

Modified Files:
src/usr.bin/ldd: ldd_elfxx.c

Log Message:
need 


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/ldd/ldd_elfxx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/ldd_elfxx.c
diff -u src/usr.bin/ldd/ldd_elfxx.c:1.6 src/usr.bin/ldd/ldd_elfxx.c:1.7
--- src/usr.bin/ldd/ldd_elfxx.c:1.6	Sat Jul  7 20:53:44 2012
+++ src/usr.bin/ldd/ldd_elfxx.c	Tue Jan 10 16:11:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd_elfxx.c,v 1.6 2012/07/08 00:53:44 matt Exp $	*/
+/*	$NetBSD: ldd_elfxx.c,v 1.7 2017/01/10 21:11:25 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,12 +62,13 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ldd_elfxx.c,v 1.6 2012/07/08 00:53:44 matt Exp $");
+__RCSID("$NetBSD: ldd_elfxx.c,v 1.7 2017/01/10 21:11:25 christos Exp $");
 #endif /* not lint */
 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 



CVS commit: src/usr.bin/ldd

2015-06-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jun 13 20:38:52 UTC 2015

Modified Files:
src/usr.bin/ldd: Makefile.inc

Log Message:
Do not set MLIBDIR if MKCOMPAT=no


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/ldd/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/Makefile.inc
diff -u src/usr.bin/ldd/Makefile.inc:1.5 src/usr.bin/ldd/Makefile.inc:1.6
--- src/usr.bin/ldd/Makefile.inc:1.5	Wed Mar 20 15:18:42 2013
+++ src/usr.bin/ldd/Makefile.inc	Sat Jun 13 20:38:52 2015
@@ -1,7 +1,9 @@
-#	$NetBSD: Makefile.inc,v 1.5 2013/03/20 15:18:42 macallan Exp $
+#	$NetBSD: Makefile.inc,v 1.6 2015/06/13 20:38:52 martin Exp $
 
 WARNS?=	3	# XXX: -Wsign-compare issues ld.elf_so source
 
+.if ${MKCOMPAT} != no
+
 .if ${MACHINE_ARCH} == sparc64
 MLIBDIR=	sparc
 .endif
@@ -21,6 +23,8 @@ COMPAT_MLIBDIR=	o32
 CPPFLAGS+= -DLDD_ELF64 -DMIPS_N32
 .endif
 
+.endif	# MKCOMPAT
+
 .if exists(${.CURDIR}/../../Makefile.inc)
 .include ${.CURDIR}/../../Makefile.inc
 .endif



CVS commit: src/usr.bin/ldd/elf64

2014-08-28 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 28 12:23:29 UTC 2014

Modified Files:
src/usr.bin/ldd/elf64: Makefile

Log Message:
Fix ldd on LP64 platforms by splitting the symbol versioning stuff for
elf64 as well.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/ldd/elf64/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/elf64/Makefile
diff -u src/usr.bin/ldd/elf64/Makefile:1.7 src/usr.bin/ldd/elf64/Makefile:1.8
--- src/usr.bin/ldd/elf64/Makefile:1.7	Sun Mar  2 03:55:19 2014
+++ src/usr.bin/ldd/elf64/Makefile	Thu Aug 28 12:23:29 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2014/03/02 03:55:19 matt Exp $
+#	$NetBSD: Makefile,v 1.8 2014/08/28 12:23:29 joerg Exp $
 
 .include bsd.own.mk
 
@@ -25,6 +25,8 @@ RTLD_FUNCS	= \
 	_rtld_map_object \
 	_rtld_obj_free \
 	_rtld_obj_new \
+	_rtld_object_add_name \
+	_rtld_object_match_name \
 	_rtld_add_paths \
 	_rtld_process_hints \
 	_rtld_sysctl \



CVS commit: src/usr.bin/ldd

2014-03-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Mar  2 03:55:19 UTC 2014

Modified Files:
src/usr.bin/ldd: ldd.c
src/usr.bin/ldd/build: Makefile
src/usr.bin/ldd/elf32: Makefile
src/usr.bin/ldd/elf64: Makefile

Log Message:
Use OBJECT_FMTS from bsd.own.mk to determine elf32/elf64 needs


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/ldd/ldd.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/ldd/build/Makefile
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/ldd/elf32/Makefile
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/ldd/elf64/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/ldd.c
diff -u src/usr.bin/ldd/ldd.c:1.21 src/usr.bin/ldd/ldd.c:1.22
--- src/usr.bin/ldd/ldd.c:1.21	Wed Mar 20 15:18:42 2013
+++ src/usr.bin/ldd/ldd.c	Sun Mar  2 03:55:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.c,v 1.21 2013/03/20 15:18:42 macallan Exp $	*/
+/*	$NetBSD: ldd.c,v 1.22 2014/03/02 03:55:19 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: ldd.c,v 1.21 2013/03/20 15:18:42 macallan Exp $);
+__RCSID($NetBSD: ldd.c,v 1.22 2014/03/02 03:55:19 matt Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -165,7 +165,7 @@ main(int argc, char **argv)
 		}
 		if (elf_ldd(fd, *argv, fmt1, fmt2) == -1
 		/* Alpha never had 32 bit support. */
-#if (defined(_LP64)  !defined(__alpha__)) || defined(MIPS_N32)
+#if (defined(_LP64)  !defined(ELF64_ONLY)) || defined(MIPS_N32)
 		 elf32_ldd(fd, *argv, fmt1, fmt2) == -1
 #if defined(__mips__)  0 /* XXX this is still hosed for some reason */
 		 elf32_ldd_compat(fd, *argv, fmt1, fmt2) == -1

Index: src/usr.bin/ldd/build/Makefile
diff -u src/usr.bin/ldd/build/Makefile:1.1 src/usr.bin/ldd/build/Makefile:1.2
--- src/usr.bin/ldd/build/Makefile:1.1	Fri Apr 15 08:47:02 2011
+++ src/usr.bin/ldd/build/Makefile	Sun Mar  2 03:55:19 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2011/04/15 08:47:02 plunky Exp $
+#	$NetBSD: Makefile,v 1.2 2014/03/02 03:55:19 matt Exp $
 
 .include bsd.own.mk		# for MKDYNAMICROOT definition
 
@@ -8,9 +8,11 @@ MAN=	ldd.1
 
 .PATH: ${.CURDIR}/..
 
-.if (${MACHINE_ARCH} != alpha)
+.if ${OBJECT_FMTS:Melf32} != 
 LIB_ELF32DIR!=	cd ${.CURDIR}/../elf32  ${PRINTOBJDIR}
 EXTRA_LIBS+=	${LIB_ELF32DIR}/libldd_elf32.a
+.else
+CPPFLAGS.ldd.c+= -DELF64_ONLY
 .endif
 
 .if (${MACHINE_ARCH} == mips64el) || (${MACHINE_ARCH} == mips64eb)
@@ -18,14 +20,12 @@ LIB_ELF32COMPATDIR!=	cd ${.CURDIR}/../el
 EXTRA_LIBS+=		${LIB_ELF32COMPATDIR}/libldd_elf32_compat.a
 .endif
 
-.if (${MACHINE_ARCH} == alpha) || (${MACHINE_ARCH} == sparc64) || \
-(${MACHINE_ARCH} == x86_64) || (${MACHINE_ARCH} == powerpc64) || \
-(${MACHINE_ARCH} == mips64el) || (${MACHINE_ARCH} == mips64eb)
+.if ${OBJECT_FMTS:Melf64} != 
 LIB_ELF64DIR!=	cd ${.CURDIR}/../elf64  ${PRINTOBJDIR}
 EXTRA_LIBS+=	${LIB_ELF64DIR}/libldd_elf64.a
-CPPFLAGS.ldd.c= -DELFSIZE=64
+CPPFLAGS.ldd.c+= -DELFSIZE=64
 .else
-CPPFLAGS.ldd.c= -DELFSIZE=32
+CPPFLAGS.ldd.c+= -DELFSIZE=32
 .endif
 
 LDADD+=	${EXTRA_LIBS}

Index: src/usr.bin/ldd/elf32/Makefile
diff -u src/usr.bin/ldd/elf32/Makefile:1.8 src/usr.bin/ldd/elf32/Makefile:1.9
--- src/usr.bin/ldd/elf32/Makefile:1.8	Wed Mar  9 23:10:08 2011
+++ src/usr.bin/ldd/elf32/Makefile	Sun Mar  2 03:55:19 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2011/03/09 23:10:08 joerg Exp $
+#	$NetBSD: Makefile,v 1.9 2014/03/02 03:55:19 matt Exp $
 
 .include bsd.own.mk
 .include bsd.init.mk
@@ -24,7 +24,7 @@ LIBISPRIVATE=	yes
 CPPFLAGS+=	-DRTLD_ARCH_SUBDIR=\${MLIBDIR}\
 .endif
 
-.if ${MACHINE_ARCH} != alpha
+.if ${OBJECT_FMTS:Melf32} != 
 .include ../Makefile.elf
 .endif
 

Index: src/usr.bin/ldd/elf64/Makefile
diff -u src/usr.bin/ldd/elf64/Makefile:1.6 src/usr.bin/ldd/elf64/Makefile:1.7
--- src/usr.bin/ldd/elf64/Makefile:1.6	Wed Mar  9 23:10:08 2011
+++ src/usr.bin/ldd/elf64/Makefile	Sun Mar  2 03:55:19 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2011/03/09 23:10:08 joerg Exp $
+#	$NetBSD: Makefile,v 1.7 2014/03/02 03:55:19 matt Exp $
 
 .include bsd.own.mk
 
@@ -11,9 +11,7 @@ SRCS=	dummy.c
 LIBISPRIVATE=	yes
 .PATH: ${.CURDIR}/..
 
-.if (${MACHINE_ARCH} == alpha) || (${MACHINE_ARCH} == sparc64) || \
-(${MACHINE_ARCH} == x86_64) || (${MACHINE_ARCH} == powerpc64) || \
-(${MACHINE_ARCH} == mips64el) || (${MACHINE_ARCH} == mips64eb)
+.if ${OBJECT_FMTS:Melf64} != 
 
 # XXX we need to make sure that we don't accidentally get the elf32
 # XXX versions of these.



CVS commit: src/usr.bin/ldd

2013-05-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  7 13:00:36 UTC 2013

Modified Files:
src/usr.bin/ldd: Makefile.elf

Log Message:
include symver.c


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/ldd/Makefile.elf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/Makefile.elf
diff -u src/usr.bin/ldd/Makefile.elf:1.4 src/usr.bin/ldd/Makefile.elf:1.5
--- src/usr.bin/ldd/Makefile.elf:1.4	Wed Mar  9 18:10:08 2011
+++ src/usr.bin/ldd/Makefile.elf	Tue May  7 09:00:35 2013
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile.elf,v 1.4 2011/03/09 23:10:08 joerg Exp $
+#	$NetBSD: Makefile.elf,v 1.5 2013/05/07 13:00:35 christos Exp $
 
 # Makefile fragment to build a (32 or 64 bit) libldd_elfxx.a.
 # Expects CPPFLAGS to have ELFSIZE set, and LIB to be set.
 
 SRCS=	ldd_elfxx.c
 SRCS+=	xmalloc.c debug.c expand.c map_object.c load.c search.c \
-	headers.c paths.c tls.c
+	headers.c paths.c tls.c symver.c
 
 .include Makefile.common



CVS commit: src/usr.bin/ldd

2013-04-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Apr 25 07:12:46 UTC 2013

Modified Files:
src/usr.bin/ldd: Makefile.common

Log Message:
If earm, include from lib/libexecinfo for unwind.h


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/ldd/Makefile.common

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/Makefile.common
diff -u src/usr.bin/ldd/Makefile.common:1.2 src/usr.bin/ldd/Makefile.common:1.3
--- src/usr.bin/ldd/Makefile.common:1.2	Fri Feb 17 08:13:18 2012
+++ src/usr.bin/ldd/Makefile.common	Thu Apr 25 07:12:46 2013
@@ -1,8 +1,11 @@
-#	$NetBSD: Makefile.common,v 1.2 2012/02/17 08:13:18 matt Exp $
+#	$NetBSD: Makefile.common,v 1.3 2013/04/25 07:12:46 matt Exp $
 
 LDELFSO=${NETBSDSRCDIR}/libexec/ld.elf_so
 CPPFLAGS+= -I${LDELFSO} -DLIBDIR=\${LIBDIR}\
 CPPFLAGS+= -D_RTLD_SOURCE
+.if !empty(MACHINE_ARCH:Mearm*)
+CPPFLAGS+= -I${NETBSDSRCDIR}/lib/libexecinfo
+.endif
 #CPPFLAGS+= -DDEBUG
 .PATH: ${LDELFSO}
 



CVS commit: src/usr.bin/ldd

2013-03-20 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Mar 20 15:18:42 UTC 2013

Modified Files:
src/usr.bin/ldd: Makefile.inc ldd.c

Log Message:
apply kludge to make this more or less work on mips64 with n32 userland
with this ldd can handle both 64 and n32 binaries ( previously it would do 64
only ), o32 support is still broken
Someone more familiar with this code needs to fix this properly.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/ldd/Makefile.inc
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/ldd/ldd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/Makefile.inc
diff -u src/usr.bin/ldd/Makefile.inc:1.4 src/usr.bin/ldd/Makefile.inc:1.5
--- src/usr.bin/ldd/Makefile.inc:1.4	Tue Dec 15 04:06:43 2009
+++ src/usr.bin/ldd/Makefile.inc	Wed Mar 20 15:18:42 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.4 2009/12/15 04:06:43 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.5 2013/03/20 15:18:42 macallan Exp $
 
 WARNS?=	3	# XXX: -Wsign-compare issues ld.elf_so source
 
@@ -18,7 +18,7 @@ MLIBDIR=	powerpc
 .if (${MACHINE_ARCH} == mips64eb) || (${MACHINE_ARCH} == mips64el)
 MLIBDIR=	64
 COMPAT_MLIBDIR=	o32
-CPPFLAGS+= -DLDD_ELF64
+CPPFLAGS+= -DLDD_ELF64 -DMIPS_N32
 .endif
 
 .if exists(${.CURDIR}/../../Makefile.inc)

Index: src/usr.bin/ldd/ldd.c
diff -u src/usr.bin/ldd/ldd.c:1.20 src/usr.bin/ldd/ldd.c:1.21
--- src/usr.bin/ldd/ldd.c:1.20	Sun Jul  8 00:53:44 2012
+++ src/usr.bin/ldd/ldd.c	Wed Mar 20 15:18:42 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.c,v 1.20 2012/07/08 00:53:44 matt Exp $	*/
+/*	$NetBSD: ldd.c,v 1.21 2013/03/20 15:18:42 macallan Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: ldd.c,v 1.20 2012/07/08 00:53:44 matt Exp $);
+__RCSID($NetBSD: ldd.c,v 1.21 2013/03/20 15:18:42 macallan Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -165,9 +165,9 @@ main(int argc, char **argv)
 		}
 		if (elf_ldd(fd, *argv, fmt1, fmt2) == -1
 		/* Alpha never had 32 bit support. */
-#if defined(_LP64)  !defined(__alpha__)
+#if (defined(_LP64)  !defined(__alpha__)) || defined(MIPS_N32)
 		 elf32_ldd(fd, *argv, fmt1, fmt2) == -1
-#ifdef __mips__
+#if defined(__mips__)  0 /* XXX this is still hosed for some reason */
 		 elf32_ldd_compat(fd, *argv, fmt1, fmt2) == -1
 #endif
 #endif



CVS commit: src/usr.bin/ldd

2012-07-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jul  8 00:53:45 UTC 2012

Modified Files:
src/usr.bin/ldd: ldd.c ldd.h ldd_elfxx.c

Log Message:
Make sure stuff using Obj_Entry is compiled correctly for ELF32 or ELF64.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/ldd/ldd.c
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/ldd/ldd.h
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/ldd/ldd_elfxx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/ldd.c
diff -u src/usr.bin/ldd/ldd.c:1.19 src/usr.bin/ldd/ldd.c:1.20
--- src/usr.bin/ldd/ldd.c:1.19	Tue May 24 12:27:29 2011
+++ src/usr.bin/ldd/ldd.c	Sun Jul  8 00:53:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.c,v 1.19 2011/05/24 12:27:29 joerg Exp $	*/
+/*	$NetBSD: ldd.c,v 1.20 2012/07/08 00:53:44 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: ldd.c,v 1.19 2011/05/24 12:27:29 joerg Exp $);
+__RCSID($NetBSD: ldd.c,v 1.20 2012/07/08 00:53:44 matt Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -89,6 +89,10 @@ __RCSID($NetBSD: ldd.c,v 1.19 2011/05/2
  */
 static char *error_message;	/* Message for dlopen(), or NULL */
 bool _rtld_trust;		/* False for setuid and setgid programs */
+/*
+ * This may be ELF64 or ELF32 but since they are used opaquely it doesn't
+ * really matter.
+ */
 Obj_Entry *_rtld_objlist;	/* Head of linked list of shared objects */
 Obj_Entry **_rtld_objtail = _rtld_objlist;
 /* Link field of last object in list */
@@ -200,111 +204,6 @@ dlerror()
 }
 
 void
-fmtprint(const char *libname, Obj_Entry *obj, const char *fmt1,
-const char *fmt2)
-{
-	const char *libpath = obj ? obj-path : not found;
-	char libnamebuf[200];
-	char *libmajor = NULL;
-	const char *fmt;
-	char *cp;
-	int c;
-
-	if (strncmp(libname, lib, 3) == 0 
-	(cp = strstr(libname, .so)) != NULL) {
-		size_t i = cp - (libname + 3);
-
-		if (i = sizeof(libnamebuf))
-			i = sizeof(libnamebuf) - 1;
-		(void)memcpy(libnamebuf, libname + 3, i);
-		libnamebuf[i] = '\0';
-		if (cp[3]  isdigit((unsigned char)cp[4]))
-			libmajor = cp[4];
-		libname = libnamebuf;
-	}
-
-	if (fmt1 == NULL)
-		fmt1 = libmajor != NULL ?
-		\t-l%o.%m = %p\n :
-		\t-l%o = %p\n;
-	if (fmt2 == NULL)
-		fmt2 = \t%o = %p\n;
-
-	fmt = libname == libnamebuf ? fmt1 : fmt2;
-	while ((c = *fmt++) != '\0') {
-		switch (c) {
-		default:
-			putchar(c);
-			continue;
-		case '\\':
-			switch (c = *fmt) {
-			case '\0':
-continue;
-			case 'n':
-putchar('\n');
-break;
-			case 't':
-putchar('\t');
-break;
-			}
-			break;
-		case '%':
-			switch (c = *fmt) {
-			case '\0':
-continue;
-			case '%':
-			default:
-putchar(c);
-break;
-			case 'A':
-printf(%s, main_local);
-break;
-			case 'a':
-printf(%s, main_progname);
-break;
-			case 'o':
-printf(%s, libname);
-break;
-			case 'm':
-printf(%s, libmajor);
-break;
-			case 'n':
-/* XXX: not supported for elf */
-break;
-			case 'p':
-printf(%s, libpath);
-break;
-			case 'x':
-printf(%p, obj ? obj-mapbase : 0);
-break;
-			}
-			break;
-		}
-		++fmt;
-	}
-}
-
-void
-print_needed(Obj_Entry *obj, const char *fmt1, const char *fmt2)
-{
-	const Needed_Entry *needed;
-
-	for (needed = obj-needed; needed != NULL; needed = needed-next) {
-		const char *libname = obj-strtab + needed-name;
-
-		if (needed-obj != NULL) {
-			if (!needed-obj-printed) {
-fmtprint(libname, needed-obj, fmt1, fmt2);
-needed-obj-printed = 1;
-print_needed(needed-obj, fmt1, fmt2);
-			}
-		} else {
-			fmtprint(libname, needed-obj, fmt1, fmt2);
-		}
-	}
-}
-
-void
 _rtld_die(void)
 {
 	const char *msg = dlerror();

Index: src/usr.bin/ldd/ldd.h
diff -u src/usr.bin/ldd/ldd.h:1.6 src/usr.bin/ldd/ldd.h:1.7
--- src/usr.bin/ldd/ldd.h:1.6	Tue Dec 15 04:06:43 2009
+++ src/usr.bin/ldd/ldd.h	Sun Jul  8 00:53:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.h,v 1.6 2009/12/15 04:06:43 mrg Exp $	*/
+/*	$NetBSD: ldd.h,v 1.7 2012/07/08 00:53:44 matt Exp $	*/
 
 /*
  * Copyright (c) 2008 Matthew R. Green
@@ -43,8 +43,5 @@ int elf64_ldd(int, char *, const char *,
 #define elf_ldd elf32_ldd
 #endif
 
-void fmtprint(const char *, Obj_Entry *, const char *, const char *);
-void print_needed(Obj_Entry *, const char *, const char *);
-
 extern char *main_local;
 extern char *main_progname;

Index: src/usr.bin/ldd/ldd_elfxx.c
diff -u src/usr.bin/ldd/ldd_elfxx.c:1.5 src/usr.bin/ldd/ldd_elfxx.c:1.6
--- src/usr.bin/ldd/ldd_elfxx.c:1.5	Thu Jun 30 20:09:41 2011
+++ src/usr.bin/ldd/ldd_elfxx.c	Sun Jul  8 00:53:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd_elfxx.c,v 1.5 2011/06/30 20:09:41 wiz Exp $	*/
+/*	$NetBSD: ldd_elfxx.c,v 1.6 2012/07/08 00:53:44 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include sys/cdefs.h
 #ifndef lint

CVS commit: src/usr.bin/ldd

2012-02-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 17 08:13:18 UTC 2012

Modified Files:
src/usr.bin/ldd: Makefile.common

Log Message:
MIPS uses a variable page size now.
(pulled up from matt-nb5-mips64)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/ldd/Makefile.common

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/Makefile.common
diff -u src/usr.bin/ldd/Makefile.common:1.1 src/usr.bin/ldd/Makefile.common:1.2
--- src/usr.bin/ldd/Makefile.common:1.1	Tue Jan  6 03:59:56 2009
+++ src/usr.bin/ldd/Makefile.common	Fri Feb 17 08:13:18 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.common,v 1.1 2009/01/06 03:59:56 mrg Exp $
+#	$NetBSD: Makefile.common,v 1.2 2012/02/17 08:13:18 matt Exp $
 
 LDELFSO=${NETBSDSRCDIR}/libexec/ld.elf_so
 CPPFLAGS+= -I${LDELFSO} -DLIBDIR=\${LIBDIR}\
@@ -8,6 +8,6 @@ CPPFLAGS+= -D_RTLD_SOURCE
 
 .if (${MACHINE_ARCH} == sparc) || (${MACHINE_ARCH} == sparc64) || \
 (${MACHINE_ARCH} == arm) || (${MACHINE_ARCH} == m68k) || \
-(${MACHINE_ARCH} == powerpc)
+(${MACHINE_ARCH} == powerpc) || (${MACHINE_ARCH:Mmips*} != )
 CPPFLAGS+= -DVARPSZ
 .endif



CVS commit: src/usr.bin/ldd

2011-05-24 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue May 24 12:27:30 UTC 2011

Modified Files:
src/usr.bin/ldd: ldd.c

Log Message:
Fix sign compare


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/ldd/ldd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/ldd.c
diff -u src/usr.bin/ldd/ldd.c:1.18 src/usr.bin/ldd/ldd.c:1.19
--- src/usr.bin/ldd/ldd.c:1.18	Tue Mar 29 20:56:35 2011
+++ src/usr.bin/ldd/ldd.c	Tue May 24 12:27:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.c,v 1.18 2011/03/29 20:56:35 joerg Exp $	*/
+/*	$NetBSD: ldd.c,v 1.19 2011/05/24 12:27:29 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: ldd.c,v 1.18 2011/03/29 20:56:35 joerg Exp $);
+__RCSID($NetBSD: ldd.c,v 1.19 2011/05/24 12:27:29 joerg Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -212,7 +212,7 @@
 
 	if (strncmp(libname, lib, 3) == 0 
 	(cp = strstr(libname, .so)) != NULL) {
-		int i = cp - (libname + 3);
+		size_t i = cp - (libname + 3);
 
 		if (i = sizeof(libnamebuf))
 			i = sizeof(libnamebuf) - 1;



CVS commit: src/usr.bin/ldd

2010-02-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Feb 23 08:23:24 UTC 2010

Modified Files:
src/usr.bin/ldd: ldd.c

Log Message:
Mark each object as printed as visited and then print.

Fixes PR/48211.

As a side effect the libraries are printed in, imo, a better order.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/ldd/ldd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/ldd.c
diff -u src/usr.bin/ldd/ldd.c:1.12 src/usr.bin/ldd/ldd.c:1.13
--- src/usr.bin/ldd/ldd.c:1.12	Sun Dec 13 08:50:56 2009
+++ src/usr.bin/ldd/ldd.c	Tue Feb 23 08:23:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.c,v 1.12 2009/12/13 08:50:56 mrg Exp $	*/
+/*	$NetBSD: ldd.c,v 1.13 2010/02/23 08:23:24 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: ldd.c,v 1.12 2009/12/13 08:50:56 mrg Exp $);
+__RCSID($NetBSD: ldd.c,v 1.13 2010/02/23 08:23:24 skrll Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -290,10 +290,10 @@
 		const char *libname = obj-strtab + needed-name;
 
 		if (needed-obj != NULL) {
-			print_needed(needed-obj, fmt1, fmt2);
 			if (!needed-obj-printed) {
 fmtprint(libname, needed-obj, fmt1, fmt2);
 needed-obj-printed = 1;
+print_needed(needed-obj, fmt1, fmt2);
 			}
 		} else {
 			fmtprint(libname, needed-obj, fmt1, fmt2);



CVS commit: src/usr.bin/ldd

2009-12-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Dec 15 04:06:43 UTC 2009

Modified Files:
src/usr.bin/ldd: Makefile Makefile.inc ldd.h

Log Message:
make this actually build on mips64.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/ldd/Makefile
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/ldd/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/ldd/ldd.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/Makefile
diff -u src/usr.bin/ldd/Makefile:1.14 src/usr.bin/ldd/Makefile:1.15
--- src/usr.bin/ldd/Makefile:1.14	Sun Dec 13 08:50:56 2009
+++ src/usr.bin/ldd/Makefile	Tue Dec 15 04:06:43 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.14 2009/12/13 08:50:56 mrg Exp $
+#	$NetBSD: Makefile,v 1.15 2009/12/15 04:06:43 mrg Exp $
 
 WARNS?=	3	# XXX: -Wsign-compare issues ld.elf_so source
 
@@ -9,7 +9,7 @@
 MAN=	ldd.1
 
 
-SUBDIR+= 	elf32 elf64
+SUBDIR+= 	elf32 elf64 elf32_compat
 
 .if (${MACHINE_ARCH} != alpha)
 LIB_ELF32DIR!=	cd ${.CURDIR}/elf32  ${PRINTOBJDIR}

Index: src/usr.bin/ldd/Makefile.inc
diff -u src/usr.bin/ldd/Makefile.inc:1.3 src/usr.bin/ldd/Makefile.inc:1.4
--- src/usr.bin/ldd/Makefile.inc:1.3	Sun Dec 13 08:50:56 2009
+++ src/usr.bin/ldd/Makefile.inc	Tue Dec 15 04:06:43 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.3 2009/12/13 08:50:56 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.4 2009/12/15 04:06:43 mrg Exp $
 
 WARNS?=	3	# XXX: -Wsign-compare issues ld.elf_so source
 
@@ -18,6 +18,7 @@
 .if (${MACHINE_ARCH} == mips64eb) || (${MACHINE_ARCH} == mips64el)
 MLIBDIR=	64
 COMPAT_MLIBDIR=	o32
+CPPFLAGS+= -DLDD_ELF64
 .endif
 
 .if exists(${.CURDIR}/../../Makefile.inc)

Index: src/usr.bin/ldd/ldd.h
diff -u src/usr.bin/ldd/ldd.h:1.5 src/usr.bin/ldd/ldd.h:1.6
--- src/usr.bin/ldd/ldd.h:1.5	Sun Dec 13 08:50:56 2009
+++ src/usr.bin/ldd/ldd.h	Tue Dec 15 04:06:43 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.h,v 1.5 2009/12/13 08:50:56 mrg Exp $	*/
+/*	$NetBSD: ldd.h,v 1.6 2009/12/15 04:06:43 mrg Exp $	*/
 
 /*
  * Copyright (c) 2008 Matthew R. Green
@@ -31,6 +31,10 @@
 int elf32_ldd(int, char *, const char *, const char *);
 
 #ifdef _LP64
+#define LDD_ELF64
+#endif
+
+#ifdef LDD_ELF64
 int elf64_ldd(int, char *, const char *, const char *);
 #define elf_ldd elf64_ldd
 #elif defined(ELF32_COMPAT)



CVS commit: src/usr.bin/ldd

2009-09-07 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Sep  7 17:56:52 UTC 2009

Modified Files:
src/usr.bin/ldd: ldd.1 ldd.c

Log Message:
Add an -o option that behaves like nm -o. Implementation from a suggestion
by jmcneill (thanks!); ok mrg. Closes PR 41994.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/ldd/ldd.1
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/ldd/ldd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/ldd.1
diff -u src/usr.bin/ldd/ldd.1:1.16 src/usr.bin/ldd/ldd.1:1.17
--- src/usr.bin/ldd/ldd.1:1.16	Sun Aug 23 15:37:39 2009
+++ src/usr.bin/ldd/ldd.1	Mon Sep  7 17:56:52 2009
@@ -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.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd August 23, 2009
+.Dd September 7, 2009
 .Dt LDD 1
 .Os
 .Sh NAME
@@ -35,6 +35,7 @@
 .Nd list dynamic object dependencies
 .Sh SYNOPSIS
 .Nm
+.Op Fl o
 .Op Fl f Ar format
 .Ar program ...
 .Sh DESCRIPTION
@@ -93,6 +94,16 @@
 and
 .Sy \et
 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
 .Xr ld 1 ,
 .Xr ld.elf_so 1 ,

Index: src/usr.bin/ldd/ldd.c
diff -u src/usr.bin/ldd/ldd.c:1.9 src/usr.bin/ldd/ldd.c:1.10
--- src/usr.bin/ldd/ldd.c:1.9	Sat Aug 22 06:52:16 2009
+++ src/usr.bin/ldd/ldd.c	Mon Sep  7 17:56:52 2009
@@ -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.
@@ -62,7 +62,7 @@
 
 #include sys/cdefs.h
 #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 */
 
 #include sys/types.h
@@ -114,13 +114,13 @@
 int
 main(int argc, char **argv)
 {
-	char *fmt1 = NULL, *fmt2 = NULL;
+	const char *fmt1 = NULL, *fmt2 = NULL;
 	int c;
 
 #ifdef DEBUG
 	debug = 1;
 #endif
-	while ((c = getopt(argc, argv, f:)) != -1) {
+	while ((c = getopt(argc, argv, f:o)) != -1) {
 		switch (c) {
 		case 'f':
 			if (fmt1) {
@@ -130,6 +130,11 @@
 			} else
 fmt1 = optarg;
 			break;
+		case 'o':
+			if (fmt1 || fmt2)
+errx(1, Cannot use -o and -f together);
+			fmt1 = %a:-l%o.%m = %p\n;
+			break;
 		default:
 			usage();
 			/*NOTREACHED*/



CVS commit: src/usr.bin/ldd

2009-09-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Sep  7 20:06:21 UTC 2009

Modified Files:
src/usr.bin/ldd: ldd.1

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/ldd/ldd.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/ldd.1
diff -u src/usr.bin/ldd/ldd.1:1.17 src/usr.bin/ldd/ldd.1:1.18
--- src/usr.bin/ldd/ldd.1:1.17	Mon Sep  7 17:56:52 2009
+++ src/usr.bin/ldd/ldd.1	Mon Sep  7 20:06:21 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: ldd.1,v 1.17 2009/09/07 17:56:52 dholland Exp $
+.\	$NetBSD: ldd.1,v 1.18 2009/09/07 20:06:21 wiz Exp $
 .\
 .\ Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -49,7 +49,8 @@
 depend on yet other shared objects.
 Zero, one or two
 .Fl f
-options may be given. The argument is a format string passed to
+options may be given.
+The argument is a format string passed to
 .Xr rtld 1
 and allows customization of
 .Nm ldd Ns 's



CVS commit: src/usr.bin/ldd

2009-09-06 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Sep  7 04:49:03 UTC 2009

Modified Files:
src/usr.bin/ldd: ldd.h ldd_elfxx.c

Log Message:
Sprinkle a little const. no object diffs


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/ldd/ldd.h src/usr.bin/ldd/ldd_elfxx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/ldd.h
diff -u src/usr.bin/ldd/ldd.h:1.3 src/usr.bin/ldd/ldd.h:1.4
--- src/usr.bin/ldd/ldd.h:1.3	Sat Aug 22 06:52:16 2009
+++ src/usr.bin/ldd/ldd.h	Mon Sep  7 04:49:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.h,v 1.3 2009/08/22 06:52:16 mrg Exp $	*/
+/*	$NetBSD: ldd.h,v 1.4 2009/09/07 04:49:03 dholland Exp $	*/
 
 /*
  * Copyright (c) 2008 Matthew R. Green
@@ -28,10 +28,10 @@
  * SUCH DAMAGE.
  */
 
-int elf32_ldd(int, char *, char *, char *);
+int elf32_ldd(int, char *, const char *, const char *);
 
 #ifdef _LP64
-int elf64_ldd(int, char *, char *, char *);
+int elf64_ldd(int, char *, const char *, const char *);
 #define elf_ldd elf64_ldd
 #else
 #define elf_ldd elf32_ldd
Index: src/usr.bin/ldd/ldd_elfxx.c
diff -u src/usr.bin/ldd/ldd_elfxx.c:1.3 src/usr.bin/ldd/ldd_elfxx.c:1.4
--- src/usr.bin/ldd/ldd_elfxx.c:1.3	Thu Aug 20 19:17:19 2009
+++ src/usr.bin/ldd/ldd_elfxx.c	Mon Sep  7 04:49:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd_elfxx.c,v 1.3 2009/08/20 19:17:19 he Exp $	*/
+/*	$NetBSD: ldd_elfxx.c,v 1.4 2009/09/07 04:49:03 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: ldd_elfxx.c,v 1.3 2009/08/20 19:17:19 he Exp $);
+__RCSID($NetBSD: ldd_elfxx.c,v 1.4 2009/09/07 04:49:03 dholland Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -89,7 +89,7 @@
  * returns 0 on success and -1 on failure.
  */
 int
-ELFNAME(ldd)(int fd, char *path, char *fmt1, char *fmt2)
+ELFNAME(ldd)(int fd, char *path, const char *fmt1, const char *fmt2)
 {
 	struct stat st;
 



CVS commit: src/usr.bin/ldd

2009-08-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 23 15:37:39 UTC 2009

Modified Files:
src/usr.bin/ldd: ldd.1

Log Message:
Add missing word and bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/ldd/ldd.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/ldd.1
diff -u src/usr.bin/ldd/ldd.1:1.15 src/usr.bin/ldd/ldd.1:1.16
--- src/usr.bin/ldd/ldd.1:1.15	Sat Aug 22 06:52:16 2009
+++ src/usr.bin/ldd/ldd.1	Sun Aug 23 15:37:39 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: ldd.1,v 1.15 2009/08/22 06:52:16 mrg Exp $
+.\	$NetBSD: ldd.1,v 1.16 2009/08/23 15:37:39 wiz Exp $
 .\
 .\ Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd May 23, 2004
+.Dd August 23, 2009
 .Dt LDD 1
 .Os
 .Sh NAME
@@ -55,7 +55,7 @@
 output.
 The first format argument is used for library objects and defaults to
 .Qq \et-l%o.%m =\*[Gt] %p\en .
-The second format argument is used for non-library objects defaults to
+The second format argument is used for non-library objects and defaults to
 .Qq \et%o =\*[Gt] %p\en .
 .Pp
 These arguments are interpreted as format strings a la



CVS commit: src/usr.bin/ldd

2009-08-20 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Thu Aug 20 21:07:47 UTC 2009

Modified Files:
src/usr.bin/ldd: Makefile

Log Message:
Um, the test for mips should use MACHINE_CPU, not MACHINE_ARCH.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/ldd/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/Makefile
diff -u src/usr.bin/ldd/Makefile:1.11 src/usr.bin/ldd/Makefile:1.12
--- src/usr.bin/ldd/Makefile:1.11	Thu Aug 20 19:17:19 2009
+++ src/usr.bin/ldd/Makefile	Thu Aug 20 21:07:47 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2009/08/20 19:17:19 he Exp $
+#	$NetBSD: Makefile,v 1.12 2009/08/20 21:07:47 he Exp $
 
 WARNS?=	3	# XXX: -Wsign-compare issues ld.elf_so source
 
@@ -9,7 +9,7 @@
 MAN=	ldd.1
 
 
-.if (${MACHINE_ARCH} != mips)
+.if (${MACHINE_CPU} != mips)
 SUBDIR=		aout
 LIB_AOUTDIR!=	cd ${.CURDIR}/aout  ${PRINTOBJDIR}
 EXTRA_LIBS+=	${LIB_AOUTDIR}/libldd_aout.a



CVS commit: src/usr.bin/ldd

2009-08-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug 16 18:43:08 UTC 2009

Modified Files:
src/usr.bin/ldd: ldd_aout.c

Log Message:
More missing sys/exec_aout.h


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/ldd/ldd_aout.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/ldd_aout.c
diff -u src/usr.bin/ldd/ldd_aout.c:1.3 src/usr.bin/ldd/ldd_aout.c:1.4
--- src/usr.bin/ldd/ldd_aout.c:1.3	Tue Feb  3 03:01:02 2009
+++ src/usr.bin/ldd/ldd_aout.c	Sun Aug 16 18:43:08 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd_aout.c,v 1.3 2009/02/03 03:01:02 mrg Exp $	*/
+/*	$NetBSD: ldd_aout.c,v 1.4 2009/08/16 18:43:08 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -31,11 +31,12 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: ldd_aout.c,v 1.3 2009/02/03 03:01:02 mrg Exp $);
+__RCSID($NetBSD: ldd_aout.c,v 1.4 2009/08/16 18:43:08 martin Exp $);
 #endif /* not lint */
 
 #include sys/types.h
 #include sys/wait.h
+#include sys/exec_aout.h
 
 #include a.out.h
 #include err.h



CVS commit: src/usr.bin/ldd

2009-05-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 20 16:20:01 UTC 2009

Modified Files:
src/usr.bin/ldd: ldd.c

Log Message:
catch up with rtld changes


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/ldd/ldd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ldd/ldd.c
diff -u src/usr.bin/ldd/ldd.c:1.5 src/usr.bin/ldd/ldd.c:1.6
--- src/usr.bin/ldd/ldd.c:1.5	Mon Feb  2 22:01:02 2009
+++ src/usr.bin/ldd/ldd.c	Wed May 20 12:20:01 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.c,v 1.5 2009/02/03 03:01:02 mrg Exp $	*/
+/*	$NetBSD: ldd.c,v 1.6 2009/05/20 16:20:01 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: ldd.c,v 1.5 2009/02/03 03:01:02 mrg Exp $);
+__RCSID($NetBSD: ldd.c,v 1.6 2009/05/20 16:20:01 christos Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -94,7 +94,7 @@
 Obj_Entry **_rtld_objtail = _rtld_objlist;
 /* Link field of last object in list */
 Obj_Entry *_rtld_objmain;	/* The main program shared object */
-int _rtld_pagesz;
+unsigned int _rtld_pagesz;
 
 Search_Path *_rtld_default_paths;
 Search_Path *_rtld_paths;