From: kettenis Date: Tue, 30 Dec 2014 11:26:48 +0000 (+0000) Subject: Fix handling of R_MIPS_REL32_64 relocations that reference a symbol. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=33bf6a90bcb6a54d03bdd032e7fe1cdeab106b42;p=openbsd Fix handling of R_MIPS_REL32_64 relocations that reference a symbol. Fixes remaining problems with static PIE on mips64. --- 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) { \