Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ld.elf_so/arch/mips Make the GOT1_MASK 64-bit clean.



details:   https://anonhg.NetBSD.org/src/rev/66b49724e2be
branches:  trunk
changeset: 757811:66b49724e2be
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Sep 24 15:20:52 2010 +0000

description:
Make the GOT1_MASK 64-bit clean.

diffstat:

 libexec/ld.elf_so/arch/mips/mips_reloc.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r db1b50e82363 -r 66b49724e2be libexec/ld.elf_so/arch/mips/mips_reloc.c
--- a/libexec/ld.elf_so/arch/mips/mips_reloc.c  Fri Sep 24 15:09:29 2010 +0000
+++ b/libexec/ld.elf_so/arch/mips/mips_reloc.c  Fri Sep 24 15:20:52 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mips_reloc.c,v 1.59 2010/08/06 16:33:18 joerg Exp $    */
+/*     $NetBSD: mips_reloc.c,v 1.60 2010/09/24 15:20:52 matt Exp $     */
 
 /*
  * Copyright 1997 Michael L. Hitch <mhitch%montana.edu@localhost>
@@ -30,7 +30,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: mips_reloc.c,v 1.59 2010/08/06 16:33:18 joerg Exp $");
+__RCSID("$NetBSD: mips_reloc.c,v 1.60 2010/09/24 15:20:52 matt Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -74,6 +74,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)
@@ -426,7 +427,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 = 0; /* XXX gcc */
        int err;
 



Home | Main Index | Thread Index | Old Index