From 4bd9ff11abf2fd7ac677cb497a9eea39a0dc4060 Mon Sep 17 00:00:00 2001 From: kettenis Date: Mon, 9 Jan 2023 13:45:55 +0000 Subject: [PATCH] In preparation for upcoming execute-only support, change the magic branch instruction used by __canonicalize_funcptr_for_compare() from "bl" into "b". This allows __canonicalize_funcptr_for_compare() to execute the branch instead of decoding the instruction to find the address of _dl_bind(). This is the first step in the transition to a new ABI. Once an updated ld.so has been installed, we can change __canonicalize_funcptr_for_compare() (which lives in libgcc) and rebuild everything with a new libgcc. Only then we can actually make ld.so executable-only. ok deraadt@, miod@ --- libexec/ld.so/hppa/ldasm.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/ld.so/hppa/ldasm.S b/libexec/ld.so/hppa/ldasm.S index 13621295ef4..4d19f9bfecb 100644 --- a/libexec/ld.so/hppa/ldasm.S +++ b/libexec/ld.so/hppa/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.24 2017/08/27 21:59:52 deraadt Exp $ */ +/* $OpenBSD: ldasm.S,v 1.25 2023/01/09 13:45:55 kettenis Exp $ */ /* * Copyright (c) 2004 Michael Shalayeff @@ -113,7 +113,7 @@ EXIT(_hppa_dl_set_dp) * __canonicalize_funcptr_for_compare() function to fixup relocations * in order to do function pointer comparisons. */ - bl _dl_bind, rp + b _dl_bind ENTRY(_dl_bind_start,32) copy r3, r1 -- 2.20.1