From: kettenis Date: Fri, 28 Oct 2022 15:07:25 +0000 (+0000) Subject: Implement support for DT_MIPS_RLD_MAP_REL. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c0929e8031bc15675cbd8f9cf4429daf1f2c729d;p=openbsd Implement support for DT_MIPS_RLD_MAP_REL. ok deraadt@ --- diff --git a/libexec/ld.so/loader.c b/libexec/ld.so/loader.c index 37aee92e602..4ed2527618e 100644 --- a/libexec/ld.so/loader.c +++ b/libexec/ld.so/loader.c @@ -1,4 +1,4 @@ -/* $OpenBSD: loader.c,v 1.195 2022/01/08 06:49:41 guenther Exp $ */ +/* $OpenBSD: loader.c,v 1.196 2022/10/28 15:07:25 kettenis Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -616,7 +616,10 @@ _dl_boot(const char **argv, char **envp, const long dyn_loff, long *dl_data) */ map_link = NULL; #ifdef __mips__ - if (exe_obj->Dyn.info[DT_MIPS_RLD_MAP - DT_LOPROC + DT_NUM] != 0) + if (exe_obj->Dyn.info[DT_MIPS_RLD_MAP_REL - DT_LOPROC + DT_NUM] != 0) + map_link = (struct r_debug **)(exe_obj->Dyn.info[ + DT_MIPS_RLD_MAP_REL - DT_LOPROC + DT_NUM] + exe_loff); + else if (exe_obj->Dyn.info[DT_MIPS_RLD_MAP - DT_LOPROC + DT_NUM] != 0) map_link = (struct r_debug **)(exe_obj->Dyn.info[ DT_MIPS_RLD_MAP - DT_LOPROC + DT_NUM] + exe_loff); #endif diff --git a/sys/arch/mips64/include/exec.h b/sys/arch/mips64/include/exec.h index 1c513bd4ab2..e7d18d1a48e 100644 --- a/sys/arch/mips64/include/exec.h +++ b/sys/arch/mips64/include/exec.h @@ -1,4 +1,4 @@ -/* $OpenBSD: exec.h,v 1.9 2017/08/13 14:56:09 visa Exp $ */ +/* $OpenBSD: exec.h,v 1.10 2022/10/28 15:07:25 kettenis Exp $ */ /* * Copyright (c) 1996-2004 Per Fogelstrom, Opsycon AB @@ -63,8 +63,9 @@ #define DT_MIPS_GOTSYM 0x70000013 /* First GOT entry in .dynsym */ #define DT_MIPS_HIPAGENO 0x70000014 /* Number of GOT page table entries */ #define DT_MIPS_RLD_MAP 0x70000016 /* Address of debug map pointer */ +#define DT_MIPS_RLD_MAP_REL 0x70000035 /* Relative address of debug map ptr */ -#define DT_PROCNUM (DT_MIPS_RLD_MAP - DT_LOPROC + 1) +#define DT_PROCNUM (DT_MIPS_RLD_MAP_REL - DT_LOPROC + 1) /* * Legal values for e_flags field of Elf32_Ehdr.