Skip to content

Commit 99df7d2

Browse files
committed
[PAC] Use __has_feature macro instead of custom ones
1 parent 51e9446 commit 99df7d2

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

arch/aarch64/reloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#define CRTJMP(pc,sp) __asm__ __volatile__( \
2424
"mov sp,%1 ; br %0" : : "r"(pc), "r"(sp) : "memory" )
2525

26-
#ifdef MUSL_EXPERIMENTAL_PAC
26+
#if __has_feature(ptrauth_calls)
2727
#define TARGET_RELOCATE(dso, type, reladdr, sym, addend, is_phase_2) \
2828
do_target_reloc(dso, type, reladdr, sym, addend, is_phase_2)
2929
#define DO_TARGET_RELR(dso, dyn) do_pauth_relr(dso, dyn)

ldso/dynlink.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <dlfcn.h>
2020
#include <semaphore.h>
2121
#include <sys/membarrier.h>
22-
#ifdef MUSL_EXPERIMENTAL_PAC_INIT_FINI
22+
#if __has_feature(ptrauth_init_fini)
2323
#include <ptrauth.h>
2424
#endif
2525
#include "pthread_impl.h"
@@ -1536,7 +1536,7 @@ void __libc_exit_fini()
15361536
if (dyn[0] & (1<<DT_FINI_ARRAY)) {
15371537
size_t n = dyn[DT_FINI_ARRAYSZ]/sizeof(size_t);
15381538
size_t *fn = (size_t *)laddr(p, dyn[DT_FINI_ARRAY])+n;
1539-
#ifdef MUSL_EXPERIMENTAL_PAC_INIT_FINI
1539+
#if __has_feature(ptrauth_init_fini)
15401540
while (n--) {
15411541
ptrauth_auth_function(
15421542
(void (*)(void))*--fn,
@@ -1663,7 +1663,7 @@ static void do_init_fini(struct dso **queue)
16631663
if (dyn[0] & (1<<DT_INIT_ARRAY)) {
16641664
size_t n = dyn[DT_INIT_ARRAYSZ]/sizeof(size_t);
16651665
size_t *fn = laddr(p, dyn[DT_INIT_ARRAY]);
1666-
#ifdef MUSL_EXPERIMENTAL_PAC_INIT_FINI
1666+
#if __has_feature(ptrauth_init_fini)
16671667
while (n--) {
16681668
ptrauth_auth_function(
16691669
(void (*)(void))*fn++,

src/ldso/aarch64/reloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#ifdef MUSL_EXPERIMENTAL_PAC
1+
#if __has_feature(ptrauth_calls)
22

33
#include <stdint.h>
44
#include "reloc.h"

src/thread/aarch64/clone.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ __clone:
2525
ret
2626
// child
2727
1: ldp x1,x0,[sp],#16
28-
#if MUSL_EXPERIMENTAL_PAC
28+
#if __has_feature(ptrauth_calls)
2929
blraaz x1
3030
#else
3131
blr x1

0 commit comments

Comments
 (0)