Module Name: src
Committed By: martin
Date: Mon Jul 24 08:08:34 UTC 2017
Modified Files:
src/libexec/ld.elf_so/arch/sparc64: mdreloc.c
Log Message:
Fix thinko in previous: even if the address is an unsigned value and we
have verified the range before, we still need to mask the bit pattern
to the target instruction field.
To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/libexec/ld.elf_so/arch/sparc64/mdreloc.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/sparc64/mdreloc.c
diff -u src/libexec/ld.elf_so/arch/sparc64/mdreloc.c:1.62 src/libexec/ld.elf_so/arch/sparc64/mdreloc.c:1.63
--- src/libexec/ld.elf_so/arch/sparc64/mdreloc.c:1.62 Sun Jul 23 14:37:51 2017
+++ src/libexec/ld.elf_so/arch/sparc64/mdreloc.c Mon Jul 24 08:08:34 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: mdreloc.c,v 1.62 2017/07/23 14:37:51 martin Exp $ */
+/* $NetBSD: mdreloc.c,v 1.63 2017/07/24 08:08:34 martin Exp $ */
/*-
* Copyright (c) 2000 Eduardo Horvath.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.62 2017/07/23 14:37:51 martin Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.63 2017/07/24 08:08:34 martin Exp $");
#endif /* not lint */
#include <errno.h>
@@ -651,7 +651,7 @@ _rtld_relocate_plt_object(const Obj_Entr
* nop
*
*/
- where[1] = BAA | (offBAA >> 2);
+ where[1] = BAA | ((offBAA >> 2) & 0x7ffff);
__asm volatile("iflush %0+4" : : "r" (where));
} else if (value < (1L<<32)) {
/*