git: ee8448712065 - main - amd64 ia32 vdso: always define some __vdso_ symbols

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Thu, 09 Feb 2023 02:37:11 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=ee844871206562c6aaaa14ee4576cb20895adb00

commit ee844871206562c6aaaa14ee4576cb20895adb00
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-02-05 21:41:25 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-02-09 02:36:40 +0000

    amd64 ia32 vdso: always define some __vdso_ symbols
    
    ... regardless of the kernel config options.
    It is reported that llvm16 ld.lld warns about undefined symbols
    referenced by the VERSION script.
    
    Reviewed by:    emaste, val_packett.cool
    Discussed with: jrtc27
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D38392
---
 sys/amd64/ia32/ia32_sigtramp.S | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/sys/amd64/ia32/ia32_sigtramp.S b/sys/amd64/ia32/ia32_sigtramp.S
index f7f3fd129cc7..7d873127e848 100644
--- a/sys/amd64/ia32/ia32_sigtramp.S
+++ b/sys/amd64/ia32/ia32_sigtramp.S
@@ -84,10 +84,10 @@ __vdso_ia32_sigcode:
 	jmp	1b
 	.cfi_endproc
 
-#ifdef COMPAT_FREEBSD4
 	ALIGN_TEXT
 	.globl	__vdso_freebsd4_ia32_sigcode
 __vdso_freebsd4_ia32_sigcode:
+#ifdef COMPAT_FREEBSD4
 	calll	*IA32_SIGF_HANDLER(%esp)
 	leal	IA32_SIGF_UC4(%esp),%eax/* get ucontext */
 	pushl	%eax
@@ -97,12 +97,14 @@ __vdso_freebsd4_ia32_sigcode:
 					/* on stack */
 1:
 	jmp	1b
+#else
+	ud2
 #endif
 
-#ifdef COMPAT_43
 	ALIGN_TEXT
 	.globl	__vdso_ia32_osigcode
 __vdso_ia32_osigcode:
+#ifdef COMPAT_43
 	calll	*IA32_SIGF_HANDLER(%esp)/* call signal handler */
 	leal	IA32_SIGF_SC(%esp),%eax	/* get sigcontext */
 	pushl	%eax
@@ -111,6 +113,9 @@ __vdso_ia32_osigcode:
 	int	$0x80			/* enter kernel with args */
 1:
 	jmp	1b
+#else
+	ud2
+#endif
 
 /*
  * Our lcall $7,$0 handler remains in user mode (ring 3), since lcalls
@@ -128,7 +133,10 @@ __vdso_ia32_osigcode:
 	ALIGN_TEXT
 	.globl	__vdso_lcall_tramp
 __vdso_lcall_tramp:
+#ifdef COMPAT_43
 	int	$0x80
 1:	jmp	1b
+#else
+	ud2
 #endif
 	.p2align 1