From: kettenis Date: Mon, 9 Jan 2023 13:45:55 +0000 (+0000) Subject: In preparation for upcoming execute-only support, change the magic branch X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4bd9ff11abf2fd7ac677cb497a9eea39a0dc4060;p=openbsd 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@ --- 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