From 04c1e6d01744fb03ca322b42d70dc731c049afe4 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Fri, 27 Jul 2012 18:15:28 +0100 Subject: [PATCH] ASM code fixes for PIC compilation. --- src/system/libroot/os/arch/x86_64/system_time_asm.S | 8 ++++---- src/system/libroot/posix/arch/x86_64/siglongjmp.S | 2 +- src/system/libroot/posix/arch/x86_64/sigsetjmp.S | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/system/libroot/os/arch/x86_64/system_time_asm.S b/src/system/libroot/os/arch/x86_64/system_time_asm.S index 641c86de26..6af491a36d 100644 --- a/src/system/libroot/os/arch/x86_64/system_time_asm.S +++ b/src/system/libroot/os/arch/x86_64/system_time_asm.S @@ -20,8 +20,8 @@ FUNCTION(__x86_setup_system_time): - movq %rdi, cv_factor - movq %rsi, cv_factor_nsecs + movq %rdi, cv_factor(%rip) + movq %rsi, cv_factor_nsecs(%rip) ret FUNCTION_END(__x86_setup_system_time) @@ -31,7 +31,7 @@ FUNCTION(system_time): // (rdtsc * cv_factor) >> 32. // Factor is pre-shifted left by 32 bits. - movq cv_factor, %rcx + movq cv_factor(%rip), %rcx // Load 64-bit TSC into %eax (low), %edx (high). rdtsc @@ -56,7 +56,7 @@ FUNCTION(system_time_nsecs): // Factor has not been pre-shifted here, otherwise we may lose the upper // 32 bits. - movq cv_factor_nsecs, %rcx + movq cv_factor_nsecs(%rip), %rcx // Load 64-bit TSC into %eax (low), %edx (high). rdtsc diff --git a/src/system/libroot/posix/arch/x86_64/siglongjmp.S b/src/system/libroot/posix/arch/x86_64/siglongjmp.S index 5acae0990f..c42f7adb11 100644 --- a/src/system/libroot/posix/arch/x86_64/siglongjmp.S +++ b/src/system/libroot/posix/arch/x86_64/siglongjmp.S @@ -24,7 +24,7 @@ FUNCTION(_longjmp): push %rax // __longjmp_return restores the signal mask and sets the return value. - call __longjmp_return + call __longjmp_return@PLT ret FUNCTION_END(siglongjmp) diff --git a/src/system/libroot/posix/arch/x86_64/sigsetjmp.S b/src/system/libroot/posix/arch/x86_64/sigsetjmp.S index 0e7b5afc77..70866974dc 100644 --- a/src/system/libroot/posix/arch/x86_64/sigsetjmp.S +++ b/src/system/libroot/posix/arch/x86_64/sigsetjmp.S @@ -24,7 +24,7 @@ FUNCTION(sigsetjmp): movq %r15, JMP_REGS_R15(%rdi) // __setjmp_save_sigs handles signal mask and return value. - jmp __setjmp_save_sigs + jmp __setjmp_save_sigs@PLT FUNCTION_END(setjmp) @@ -32,7 +32,7 @@ FUNCTION_END(setjmp) FUNCTION(setjmp): // Jump to sigsetjmp with a zero saveMask. xorl %esi, %esi - jmp sigsetjmp + jmp sigsetjmp@PLT FUNCTION_END(setjmp)