[Devel] [PATCH vz8] vdso, vclock_gettime: fix linking with old linkers

Andrey Ryabinin aryabinin at virtuozzo.com
Mon Nov 9 20:47:10 MSK 2020


On some old linkers vdso fails to build because of
dynamic reloction of 've_start_time' symbol:
	VDSO2C  arch/x86/entry/vdso/vdso-image-64.c
	Error: vdso image contains dynamic relocations

I was able to figure out why new linkers doesn't generate relocation
while old ones does, but I did find out that visibility("hidden")
attribute on 've_start_time' cures the problem.

https://jira.sw.ru/browse/PSBM-121668
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 arch/x86/entry/vdso/vclock_gettime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/entry/vdso/vclock_gettime.c b/arch/x86/entry/vdso/vclock_gettime.c
index 224dbe80da66..b2f1f19319d8 100644
--- a/arch/x86/entry/vdso/vclock_gettime.c
+++ b/arch/x86/entry/vdso/vclock_gettime.c
@@ -24,7 +24,7 @@
 
 #define gtod (&VVAR(vsyscall_gtod_data))
 
-u64 ve_start_time;
+u64 ve_start_time 	__attribute__((visibility("hidden")));
 
 extern int __vdso_clock_gettime(clockid_t clock, struct timespec *ts);
 extern int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz);
-- 
2.26.2



More information about the Devel mailing list