From fba5f8d8c167217de8c8420e85acfbcbed38e7cc Mon Sep 17 00:00:00 2001 From: guenther Date: Sun, 7 Aug 2016 03:05:23 +0000 Subject: [PATCH] As with csu, alpha passes &_DYNAMIC to _reloc_alpha_got(), so just save that and pass it to _dl_boot_bind() too --- libexec/ld.so/alpha/ldasm.S | 5 +++-- libexec/ld.so/boot.c | 6 ++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libexec/ld.so/alpha/ldasm.S b/libexec/ld.so/alpha/ldasm.S index 952b0c7e174..661dc25789e 100644 --- a/libexec/ld.so/alpha/ldasm.S +++ b/libexec/ld.so/alpha/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.35 2016/05/07 19:05:23 guenther Exp $ */ +/* $OpenBSD: ldasm.S,v 1.36 2016/08/07 03:05:23 guenther Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -77,6 +77,7 @@ L2: ldiq s3, L2 /* get where the linker thought we were */ mov s2, a1 lda t5, _DYNAMIC addq s2, t5, a0 + mov a0, s6 bsr ra, _reloc_alpha_got @@ -95,7 +96,7 @@ L2: ldiq s3, L2 /* get where the linker thought we were */ mov a5, s5 lda s2, 0(sp) mov s2, a1 - mov 0, a2 /* dynamicp is unused on alpha */ + mov s6, a2 /* &_DYNAMIC */ CALL(_dl_boot_bind) mov s3, a0 /* **argv */ mov s4, a1 /* **envp */ diff --git a/libexec/ld.so/boot.c b/libexec/ld.so/boot.c index 7f2661751fa..b7b34dbeb15 100644 --- a/libexec/ld.so/boot.c +++ b/libexec/ld.so/boot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.c,v 1.11 2016/08/07 03:03:44 guenther Exp $ */ +/* $OpenBSD: boot.c,v 1.12 2016/08/07 03:05:23 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -127,9 +127,7 @@ _dl_boot_bind(const long sp, long *dl_data, Elf_Dyn *dynamicp) * Cache the data for easier access. */ -#if defined(__alpha__) - dynp = (Elf_Dyn *)((long)_DYNAMIC); -#elif defined(__arm__) +#if defined(__arm__) dynp = (Elf_Dyn *)((long)_DYNAMIC + loff); #else dynp = dynamicp; -- 2.20.1