[RHEL8,COMMIT] vdso, vclock_gettime: fix linking with old linkers

Submitted by Konstantin Khorenko on Nov. 11, 2020, 12:54 p.m.

Details

Message ID 202011111254.0ABCs8163319539@finist-co8.sw.ru
State New
Series "vdso, vclock_gettime: fix linking with old linkers"
Headers show

Commit Message

Konstantin Khorenko Nov. 11, 2020, 12:54 p.m.
The commit is pushed to "branch-rh8-4.18.0-193.6.3.vz8.4.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-193.6.3.vz8.4.17
------>
commit 998f47870c4a498d1a53c191816c3c03dda480f9
Author: Andrey Ryabinin <aryabinin@virtuozzo.com>
Date:   Wed Nov 11 15:54:08 2020 +0300

    vdso, vclock_gettime: fix linking with old linkers
    
    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.
    
    Fixes: af2c78f571e6 ("ve: add per-ve CLOCK_MONOTONIC time via
    __vdso_gettimeofday()")
    
    https://jira.sw.ru/browse/PSBM-121668
    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);