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.
This commit is contained in:
macallan 2013-03-20 15:18:42 +00:00
parent 1630987ad9
commit da8b2f53fd
2 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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