Module Name:    src
Committed By:   matt
Date:           Tue May 19 06:09:15 UTC 2015

Modified Files:
        src/lib/libc/gen: nlist_elf32.c

Log Message:
Support ELF64 on MIPS N32 even though it's ILP32.
XXX should we do this for other arches that support compat_netbsd32?


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/lib/libc/gen/nlist_elf32.c

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

Modified files:

Index: src/lib/libc/gen/nlist_elf32.c
diff -u src/lib/libc/gen/nlist_elf32.c:1.35 src/lib/libc/gen/nlist_elf32.c:1.36
--- src/lib/libc/gen/nlist_elf32.c:1.35	Wed Mar 21 02:18:14 2012
+++ src/lib/libc/gen/nlist_elf32.c	Tue May 19 06:09:15 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: nlist_elf32.c,v 1.35 2012/03/21 02:18:14 christos Exp $ */
+/* $NetBSD: nlist_elf32.c,v 1.36 2015/05/19 06:09:15 matt Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: nlist_elf32.c,v 1.35 2012/03/21 02:18:14 christos Exp $");
+__RCSID("$NetBSD: nlist_elf32.c,v 1.36 2015/05/19 06:09:15 matt Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 /* If not included by nlist_elf64.c, ELFSIZE won't be defined. */
@@ -77,13 +77,14 @@ ELFNAMEEND(__fdnlist)(int fd, struct nli
 {
 	struct stat st;
 	Elf_Ehdr ehdr;
-#if _LP64 || ELFSIZE == 32
+#if defined(_LP64) || ELFSIZE == 32 || defined(__mips_n32)
 #if (ELFSIZE == 32)
 	Elf32_Half nshdr;
 #elif (ELFSIZE == 64)
 	Elf64_Word nshdr;
 #endif
-	/* Only support 64+32 mode on LP64; no support for 64 mode on ILP32 */
+	/* Only support 64+32 mode on LP64 and MIPS N32 */
+	/* No support for 64 mode on ILP32 */
 	Elf_Ehdr *ehdrp;
 	Elf_Shdr *shdrp, *symshdrp, *symstrshdrp;
 	Elf_Sym *symp;
@@ -137,10 +138,11 @@ ELFNAMEEND(__fdnlist)(int fd, struct nli
 	default:
 		BAD;
 	}
-#if _LP64 || ELFSIZE == 32
+#if defined(_LP64) || ELFSIZE == 32 || defined(__mips_n32)
 	symshdrp = symstrshdrp = NULL;
 
-	/* Only support 64+32 mode on LP64; no support for 64 mode on ILP32 */
+	/* Only support 64+32 mode on LP64 and MIPS N32 */
+	/* No support for 64 mode on ILP32 */
 	if (S_ISCHR(st.st_mode)) {
 		const char *nlistname;
 		struct ksyms_gsymbol kg;
@@ -308,7 +310,7 @@ done:
 	rv = nent;
 unmap:
 	munmap(mappedfile, mappedsize);
-#endif /* _LP64 || ELFSIZE == 32 */
+#endif /* _LP64 || ELFSIZE == 32 || __mips_n32 */
 out:
 	return (rv);
 }

Reply via email to