diff options
author | Rich Felker <dalias@aerifal.cx> | 2015-04-14 10:22:12 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2015-04-14 10:22:12 -0400 |
commit | da7ccf822c2a7f0413868b8d99029907f1d61a41 (patch) | |
tree | 2a06b38e4acdd5622abe1b6a606f61c410121e12 | |
parent | f1faa0e12fd68379420b07ebf2eba43a5be1f2d3 (diff) | |
download | musl-da7ccf822c2a7f0413868b8d99029907f1d61a41.tar.gz musl-da7ccf822c2a7f0413868b8d99029907f1d61a41.tar.bz2 musl-da7ccf822c2a7f0413868b8d99029907f1d61a41.tar.xz musl-da7ccf822c2a7f0413868b8d99029907f1d61a41.zip |
use hidden visibility for i386 asm-internal __vsyscall symbol
otherwise the call instruction in the inline syscall asm results in
textrels without ld-time binding.
-rw-r--r-- | arch/i386/syscall_arch.h | 14 | ||||
-rw-r--r-- | src/internal/i386/syscall.s | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/arch/i386/syscall_arch.h b/arch/i386/syscall_arch.h index a4efae90..ca0ea7fb 100644 --- a/arch/i386/syscall_arch.h +++ b/arch/i386/syscall_arch.h @@ -6,49 +6,49 @@ static inline long __syscall0(long n) { unsigned long __ret; - __asm__ __volatile__ ("call __vsyscall" : "=a"(__ret) : "a"(n) : "memory"); + __asm__ __volatile__ (".hidden __vsyscall ; call __vsyscall" : "=a"(__ret) : "a"(n) : "memory"); return __ret; } static inline long __syscall1(long n, long a1) { unsigned long __ret; - __asm__ __volatile__ ("call __vsyscall" : "=a"(__ret) : "a"(n), "d"(a1) : "memory"); + __asm__ __volatile__ (".hidden __vsyscall ; call __vsyscall" : "=a"(__ret) : "a"(n), "d"(a1) : "memory"); return __ret; } static inline long __syscall2(long n, long a1, long a2) { unsigned long __ret; - __asm__ __volatile__ ("call __vsyscall" : "=a"(__ret) : "a"(n), "d"(a1), "c"(a2) : "memory"); + __asm__ __volatile__ (".hidden __vsyscall ; call __vsyscall" : "=a"(__ret) : "a"(n), "d"(a1), "c"(a2) : "memory"); return __ret; } static inline long __syscall3(long n, long a1, long a2, long a3) { unsigned long __ret; - __asm__ __volatile__ ("call __vsyscall" : "=a"(__ret) : "a"(n), "d"(a1), "c"(a2), "D"(a3) : "memory"); + __asm__ __volatile__ (".hidden __vsyscall ; call __vsyscall" : "=a"(__ret) : "a"(n), "d"(a1), "c"(a2), "D"(a3) : "memory"); return __ret; } static inline long __syscall4(long n, long a1, long a2, long a3, long a4) { unsigned long __ret; - __asm__ __volatile__ ("call __vsyscall" : "=a"(__ret) : "a"(n), "d"(a1), "c"(a2), "D"(a3), "S"(a4) : "memory"); + __asm__ __volatile__ (".hidden __vsyscall ; call __vsyscall" : "=a"(__ret) : "a"(n), "d"(a1), "c"(a2), "D"(a3), "S"(a4) : "memory"); return __ret; } static inline long __syscall5(long n, long a1, long a2, long a3, long a4, long a5) { unsigned long __ret; - __asm__ __volatile__ ("push %6 ; call __vsyscall ; add $4,%%esp" : "=a"(__ret) : "a"(n), "d"(a1), "c"(a2), "D"(a3), "S"(a4), "g"(a5) : "memory"); + __asm__ __volatile__ ("push %6 ; .hidden __vsyscall ; call __vsyscall ; add $4,%%esp" : "=a"(__ret) : "a"(n), "d"(a1), "c"(a2), "D"(a3), "S"(a4), "g"(a5) : "memory"); return __ret; } static inline long __syscall6(long n, long a1, long a2, long a3, long a4, long a5, long a6) { unsigned long __ret; - __asm__ __volatile__ ("push %6 ; call __vsyscall6 ; add $4,%%esp" : "=a"(__ret) : "a"(n), "d"(a1), "c"(a2), "D"(a3), "S"(a4), "g"(0+(long[]){a5, a6}) : "memory"); + __asm__ __volatile__ ("push %6 ; .hidden __vsyscall6 ; call __vsyscall6 ; add $4,%%esp" : "=a"(__ret) : "a"(n), "d"(a1), "c"(a2), "D"(a3), "S"(a4), "g"(0+(long[]){a5, a6}) : "memory"); return __ret; } diff --git a/src/internal/i386/syscall.s b/src/internal/i386/syscall.s index 2914acee..739201ae 100644 --- a/src/internal/i386/syscall.s +++ b/src/internal/i386/syscall.s @@ -7,6 +7,7 @@ # code, respectively), and optimizes for size/simplicity in the caller. .global __vsyscall +.hidden __vsyscall .type __vsyscall,@function __vsyscall: push %edi @@ -41,6 +42,7 @@ __vsyscall: # possible to pass two arguments on the stack. .global __vsyscall6 +.hidden __vsyscall6 .type __vsyscall6,@function __vsyscall6: push %ebp |