From c05aff73922a79a26e8bbf5327c574754102e6b8 Mon Sep 17 00:00:00 2001 From: guenther Date: Wed, 7 Dec 2022 19:21:54 +0000 Subject: [PATCH] Prefer STRONG_ALIAS() over multiple overlapping _ENTRY/_NENTRY uses, as the latter requires manual handling of _PROF_PROLOGUE. Add END()s to match ENTRY()s. ok deraadt@ --- sys/lib/libkern/arch/amd64/htonl.S | 9 +++++---- sys/lib/libkern/arch/amd64/htons.S | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sys/lib/libkern/arch/amd64/htonl.S b/sys/lib/libkern/arch/amd64/htonl.S index dbe6647e7f3..cce7babf4be 100644 --- a/sys/lib/libkern/arch/amd64/htonl.S +++ b/sys/lib/libkern/arch/amd64/htonl.S @@ -40,13 +40,14 @@ #include -_ENTRY(htonl) -_NENTRY(ntohl) -_NENTRY(bswap32) -_PROF_PROLOGUE +STRONG_ALIAS(ntohl, htonl) +STRONG_ALIAS(bswap32, htonl) + +ENTRY(htonl) RETGUARD_SETUP(htonl, r11) movl %edi,%eax bswap %eax RETGUARD_CHECK(htonl, r11) ret lfence +END(htonl) diff --git a/sys/lib/libkern/arch/amd64/htons.S b/sys/lib/libkern/arch/amd64/htons.S index c7943cf7140..9cc236e9a98 100644 --- a/sys/lib/libkern/arch/amd64/htons.S +++ b/sys/lib/libkern/arch/amd64/htons.S @@ -40,13 +40,14 @@ #include -_ENTRY(htons) -_NENTRY(ntohs) -_NENTRY(bswap16) -_PROF_PROLOGUE +STRONG_ALIAS(ntohs, htons) +STRONG_ALIAS(bswap16, htons) + +ENTRY(htons) RETGUARD_SETUP(htons, r11) movl %edi,%eax xchgb %ah,%al RETGUARD_CHECK(htons, r11) ret lfence +END(htons) -- 2.20.1