Prefer STRONG_ALIAS() over multiple overlapping _ENTRY/_NENTRY
authorguenther <guenther@openbsd.org>
Wed, 7 Dec 2022 19:21:54 +0000 (19:21 +0000)
committerguenther <guenther@openbsd.org>
Wed, 7 Dec 2022 19:21:54 +0000 (19:21 +0000)
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
sys/lib/libkern/arch/amd64/htons.S

index dbe6647..cce7bab 100644 (file)
 
 #include <machine/asm.h>
 
-_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)
index c7943cf..9cc236e 100644 (file)
 
 #include <machine/asm.h>
 
-_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)