]> git.itanic.dy.fi Git - linux-stable/commitdiff
MIPS: VDSO: Conditionally export __vdso_gettimeofday()
authorNathan Chancellor <nathan@kernel.org>
Wed, 16 Aug 2023 21:59:23 +0000 (14:59 -0700)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Wed, 23 Aug 2023 07:06:38 +0000 (09:06 +0200)
ld.lld 16.0.0 and newer defaults to '--no-undefined-version', which
causes the following error when CONFIG_MIPS_CLOCK_VSYSCALL is not set:

  ld.lld: error: version script assignment of 'LINUX_2.6' to symbol '__vdso_gettimeofday' failed: symbol not defined

Only export __vdso_gettimeofday() when it will be present in the final
object file, which clears up the error.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308170532.zxFFv25c-lkp@intel.com/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Fangrui Song <maskray@google.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/vdso/vdso.lds.S

index d90b65724d78e1c23f7ae78014d85505327f34d4..836465e3bcb8a15cb3f0f96d852d2b252c9d5e2a 100644 (file)
@@ -94,7 +94,9 @@ VERSION
 #ifndef CONFIG_MIPS_DISABLE_VDSO
        global:
                __vdso_clock_gettime;
+#ifdef CONFIG_MIPS_CLOCK_VSYSCALL
                __vdso_gettimeofday;
+#endif
                __vdso_clock_getres;
 #if _MIPS_SIM != _MIPS_SIM_ABI64
                __vdso_clock_gettime64;