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

Reply via email to