From b4d8b0883f7f55df3bf767d8671dcf08b3d71cdf Mon Sep 17 00:00:00 2001 From: guenther Date: Fri, 15 Jul 2016 09:25:47 +0000 Subject: [PATCH] Switch m88k to pass &_DYNAMIC to _dl_boot_bind() probably works: this ASM pattern is already used for _dl_dtors --- libexec/ld.so/boot.c | 4 ++-- libexec/ld.so/m88k/ldasm.S | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libexec/ld.so/boot.c b/libexec/ld.so/boot.c index 30e646cb22f..8271e386717 100644 --- a/libexec/ld.so/boot.c +++ b/libexec/ld.so/boot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.c,v 1.6 2015/12/06 23:36:12 guenther Exp $ */ +/* $OpenBSD: boot.c,v 1.7 2016/07/15 09:25:47 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -130,7 +130,7 @@ _dl_boot_bind(const long sp, long *dl_data, Elf_Dyn *dynamicp) #if defined(__alpha__) dynp = (Elf_Dyn *)((long)_DYNAMIC); #elif defined(__sparc__) || defined(__sparc64__) || defined(__powerpc__) || \ - defined(__hppa__) || defined(__sh__) + defined(__hppa__) || defined(__sh__) || defined(__m88k__) dynp = dynamicp; #else dynp = (Elf_Dyn *)((long)_DYNAMIC + loff); diff --git a/libexec/ld.so/m88k/ldasm.S b/libexec/ld.so/m88k/ldasm.S index ca2c33a854d..f4719a8507c 100644 --- a/libexec/ld.so/m88k/ldasm.S +++ b/libexec/ld.so/m88k/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.19 2016/05/07 19:05:23 guenther Exp $ */ +/* $OpenBSD: ldasm.S,v 1.20 2016/07/15 09:25:47 guenther Exp $ */ /* * Copyright (c) 2013 Miodrag Vallat. @@ -74,12 +74,10 @@ ENTRY(_dl_start) */ or %r2, %r30, 0 | kernel args or %r3, %r31, 0 | array base -#if 0 /* _dl_boot_bind() can compute this itself */ bsr 1f | the following instruction is skipped bcnd eq0, %r0, _DYNAMIC | but gives us the pc-relative offset 1: ld.hu %r5, %r1, 2 | fetch branch offset (low 16 bits) lda %r4, %r1[%r5] | -#endif bsr _dl_boot_bind ld %r2, %r30, 0 | argc -- 2.20.1