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

Submitted by Andrey Ryabinin on Nov. 9, 2020, 5:47 p.m.


Message ID 20201109174710.30958-1-aryabinin@virtuozzo.com
State New
Series "vdso, vclock_gettime: fix linking with old linkers"
Headers show

Commit Message

Andrey Ryabinin Nov. 9, 2020, 5:47 p.m.
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.

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
 arch/x86/entry/vdso/vclock_gettime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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);