Module Name:    src
Committed By:   matt
Date:           Thu Aug 19 07:07:02 UTC 2010

Modified Files:
        src/libexec/ld.elf_so/arch/mips [matt-nb5-mips64]: mips_reloc.c

Log Message:
Define the GOT1 mask in terms of Elf_Addr so that it won't truncate when
used with 64bit addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.53.10.2 -r1.53.10.3 \
    src/libexec/ld.elf_so/arch/mips/mips_reloc.c

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

Modified files:

Index: src/libexec/ld.elf_so/arch/mips/mips_reloc.c
diff -u src/libexec/ld.elf_so/arch/mips/mips_reloc.c:1.53.10.2 src/libexec/ld.elf_so/arch/mips/mips_reloc.c:1.53.10.3
--- src/libexec/ld.elf_so/arch/mips/mips_reloc.c:1.53.10.2	Sat Sep  5 18:53:13 2009
+++ src/libexec/ld.elf_so/arch/mips/mips_reloc.c	Thu Aug 19 07:07:01 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_reloc.c,v 1.53.10.2 2009/09/05 18:53:13 matt Exp $	*/
+/*	$NetBSD: mips_reloc.c,v 1.53.10.3 2010/08/19 07:07:01 matt Exp $	*/
 
 /*
  * Copyright 1997 Michael L. Hitch <mhi...@montana.edu>
@@ -30,7 +30,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: mips_reloc.c,v 1.53.10.2 2009/09/05 18:53:13 matt Exp $");
+__RCSID("$NetBSD: mips_reloc.c,v 1.53.10.3 2010/08/19 07:07:01 matt Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -75,6 +75,7 @@
 #define	ELF_R_NXTTYPE_64_P(r_type)	(0)
 #define	Elf_Sxword			Elf32_Sword
 #endif
+#define	GOT1_MASK			(~(Elf_Addr)0 >> 1)
 
 static inline Elf_Sxword
 load_ptr(void *where, size_t len)
@@ -425,7 +426,7 @@
 _rtld_bind(Elf_Word a0, Elf_Addr a1, Elf_Addr a2, Elf_Addr a3)
 {
 	Elf_Addr *got = (Elf_Addr *)(a2 - 0x7ff0);
-	const Obj_Entry *obj = (Obj_Entry *)(got[1] & 0x7fffffff);
+	const Obj_Entry *obj = (Obj_Entry *)(got[1] & GOT1_MASK);
 	Elf_Addr new_value;
 	int err;
 

Reply via email to