arch: arm: swap_helper.S: safe guarding GTEXT(z_arm_do_syscall)

z_arm_do_syscall is only defined and used when CONFIG_USERSPACE=y.

Defining the symbol z_arm_do_syscall in assembly without a corresponding
implementation is fine for GNU ld as long as the function is not
actively called, but armlink fails to link in such cases.

Safegaurd GTEXT(z_arm_do_syscall) so the symbol is only referenced when
actively used, that is when CONFIG_USERSPACE=y.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen 2021-05-23 17:23:41 +02:00 committed by Anas Nashif
commit f57483664b

View file

@ -28,7 +28,9 @@ _ASM_FILE_PROLOGUE
GTEXT(z_arm_svc)
GTEXT(z_arm_pendsv)
GTEXT(z_do_kernel_oops)
#if defined(CONFIG_USERSPACE)
GTEXT(z_arm_do_syscall)
#endif
GDATA(_kernel)