From 33bf6a90bcb6a54d03bdd032e7fe1cdeab106b42 Mon Sep 17 00:00:00 2001 From: kettenis Date: Tue, 30 Dec 2014 11:26:48 +0000 Subject: [PATCH] Fix handling of R_MIPS_REL32_64 relocations that reference a symbol. Fixes remaining problems with static PIE on mips64. --- libexec/ld.so/mips64/archdep.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/ld.so/mips64/archdep.h b/libexec/ld.so/mips64/archdep.h index 95631b08c3f..ec34a50dec0 100644 --- a/libexec/ld.so/mips64/archdep.h +++ b/libexec/ld.so/mips64/archdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archdep.h,v 1.8 2014/12/27 20:33:47 kettenis Exp $ */ +/* $OpenBSD: archdep.h,v 1.9 2014/12/30 11:26:48 kettenis Exp $ */ /* * Copyright (c) 1998-2002 Opsycon AB, Sweden. @@ -42,8 +42,8 @@ #define RELOC_REL(relp, symp, adrp, val) \ do { \ if (ELF64_R_TYPE(relp->r_info) == R_MIPS_REL32_64) { \ - if (ELF64_R_SYM(rp->r_info) != 0) \ - *adrp = symp->st_value + val; \ + if (ELF64_R_SYM(relp->r_info) != 0) \ + *adrp += symp->st_value + val; \ else \ *adrp += val; \ } else if (ELF64_R_TYPE(relp->r_info) != R_MIPS_NONE) { \ -- 2.20.1