From 55a0c4560399e8996c8f78ea46a1e2c8cb5e23c0 Mon Sep 17 00:00:00 2001 From: guenther Date: Sun, 7 Aug 2016 02:44:00 +0000 Subject: [PATCH] Teach mips64 to pass &_DYNAMIC to _dl_boot_bind(). mips64be testing by deraadt@ --- lib/csu/boot.h | 7 +------ lib/csu/mips64/md_init.h | 4 +++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/csu/boot.h b/lib/csu/boot.h index 878b15c2027..c0a541f76e6 100644 --- a/lib/csu/boot.h +++ b/lib/csu/boot.h @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.h,v 1.20 2016/08/07 02:34:52 guenther Exp $ */ +/* $OpenBSD: boot.h,v 1.21 2016/08/07 02:44:00 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -145,12 +145,7 @@ _dl_boot_bind(const long sp, long *dl_data, Elf_Dyn *dynamicp) * Scan the DYNAMIC section for the loader. * Cache the data for easier access. */ - -#if defined(__mips64__) - dynp = (Elf_Dyn *)((long)_DYNAMIC + loff); -#else dynp = dynamicp; -#endif _dl_memset(&dynld, 0, sizeof(dynld)); while (dynp->d_tag != DT_NULL) { diff --git a/lib/csu/mips64/md_init.h b/lib/csu/mips64/md_init.h index c0c614cea22..30c78cf7baa 100644 --- a/lib/csu/mips64/md_init.h +++ b/lib/csu/mips64/md_init.h @@ -1,4 +1,4 @@ -/* $OpenBSD: md_init.h,v 1.13 2016/03/20 02:32:39 guenther Exp $ */ +/* $OpenBSD: md_init.h,v 1.14 2016/08/07 02:44:00 guenther Exp $ */ /*- * Copyright (c) 2001 Ross Harvey @@ -124,6 +124,8 @@ " dsubu $s0, $ra, $s1 \n" \ " daddu $a0, $sp, 160 \n" \ " daddu $a1, $sp, 0 \n" \ + " dla $a2, _DYNAMIC \n" \ + " daddu $a2, $s0 \n" \ " dla $t9, _dl_boot_bind \n" \ " daddu $t9, $s0 \n" \ " jalr $t9 \n" \ -- 2.20.1