mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 09:26:15 +02:00
* made syscall.inc pic safe
git-svn-id: trunk@1574 -
This commit is contained in:
parent
8711adb9d1
commit
d2a111105e
@ -26,14 +26,21 @@ asm
|
|||||||
jnae .LSyscOK { Jump to error handler if error. }
|
jnae .LSyscOK { Jump to error handler if error. }
|
||||||
negq %rax
|
negq %rax
|
||||||
movq %rax,%rdx
|
movq %rax,%rdx
|
||||||
|
{$ifdef FPC_PIC}
|
||||||
|
movq fpc_threadvar_relocate_proc@GOTPCREL(%rip),%rax
|
||||||
|
movq (%rax),%rax
|
||||||
|
movq Errno@GOTPCREL(%rip),%rax
|
||||||
|
{$else FPC_PIC}
|
||||||
movq fpc_threadvar_relocate_proc,%rax
|
movq fpc_threadvar_relocate_proc,%rax
|
||||||
|
leaq Errno,%rbx
|
||||||
|
{$endif FPC_PIC}
|
||||||
testq %rax,%rax
|
testq %rax,%rax
|
||||||
jne .LThread
|
jne .LThread
|
||||||
movl %edx,Errno+8
|
movl %edx,8(%rbx)
|
||||||
jmp .LNoThread
|
jmp .LNoThread
|
||||||
.LThread:
|
.LThread:
|
||||||
pushq %rdx
|
pushq %rdx
|
||||||
movq Errno,%rdi
|
movq (%rbx),%rdi
|
||||||
call *%rax
|
call *%rax
|
||||||
popq %rdx
|
popq %rdx
|
||||||
movl %edx,(%rax)
|
movl %edx,(%rax)
|
||||||
@ -52,14 +59,21 @@ asm
|
|||||||
jnae .LSyscOK { Jump to error handler if error. }
|
jnae .LSyscOK { Jump to error handler if error. }
|
||||||
negq %rax
|
negq %rax
|
||||||
movq %rax,%rdx
|
movq %rax,%rdx
|
||||||
|
{$ifdef FPC_PIC}
|
||||||
|
movq fpc_threadvar_relocate_proc@GOTPCREL(%rip),%rax
|
||||||
|
movq (%rax),%rax
|
||||||
|
movq Errno@GOTPCREL(%rip),%rax
|
||||||
|
{$else FPC_PIC}
|
||||||
movq fpc_threadvar_relocate_proc,%rax
|
movq fpc_threadvar_relocate_proc,%rax
|
||||||
|
leaq Errno,%rbx
|
||||||
|
{$endif FPC_PIC}
|
||||||
testq %rax,%rax
|
testq %rax,%rax
|
||||||
jne .LThread
|
jne .LThread
|
||||||
movl %edx,Errno+8
|
movl %edx,8(%rbx)
|
||||||
jmp .LNoThread
|
jmp .LNoThread
|
||||||
.LThread:
|
.LThread:
|
||||||
pushq %rdx
|
pushq %rdx
|
||||||
movq Errno,%rdi
|
movq (%rbx),%rdi
|
||||||
call *%rax
|
call *%rax
|
||||||
popq %rdx
|
popq %rdx
|
||||||
movl %edx,(%rax)
|
movl %edx,(%rax)
|
||||||
@ -79,14 +93,21 @@ asm
|
|||||||
jnae .LSyscOK { Jump to error handler if error. }
|
jnae .LSyscOK { Jump to error handler if error. }
|
||||||
negq %rax
|
negq %rax
|
||||||
movq %rax,%rdx
|
movq %rax,%rdx
|
||||||
|
{$ifdef FPC_PIC}
|
||||||
|
movq fpc_threadvar_relocate_proc@GOTPCREL(%rip),%rax
|
||||||
|
movq (%rax),%rax
|
||||||
|
movq Errno@GOTPCREL(%rip),%rax
|
||||||
|
{$else FPC_PIC}
|
||||||
movq fpc_threadvar_relocate_proc,%rax
|
movq fpc_threadvar_relocate_proc,%rax
|
||||||
|
leaq Errno,%rbx
|
||||||
|
{$endif FPC_PIC}
|
||||||
testq %rax,%rax
|
testq %rax,%rax
|
||||||
jne .LThread
|
jne .LThread
|
||||||
movl %edx,Errno+8
|
movl %edx,8(%rbx)
|
||||||
jmp .LNoThread
|
jmp .LNoThread
|
||||||
.LThread:
|
.LThread:
|
||||||
pushq %rdx
|
pushq %rdx
|
||||||
movq Errno,%rdi
|
movq (%rbx),%rdi
|
||||||
call *%rax
|
call *%rax
|
||||||
popq %rdx
|
popq %rdx
|
||||||
movl %edx,(%rax)
|
movl %edx,(%rax)
|
||||||
@ -107,14 +128,21 @@ asm
|
|||||||
jnae .LSyscOK { Jump to error handler if error. }
|
jnae .LSyscOK { Jump to error handler if error. }
|
||||||
negq %rax
|
negq %rax
|
||||||
movq %rax,%rdx
|
movq %rax,%rdx
|
||||||
|
{$ifdef FPC_PIC}
|
||||||
|
movq fpc_threadvar_relocate_proc@GOTPCREL(%rip),%rax
|
||||||
|
movq (%rax),%rax
|
||||||
|
movq Errno@GOTPCREL(%rip),%rax
|
||||||
|
{$else FPC_PIC}
|
||||||
movq fpc_threadvar_relocate_proc,%rax
|
movq fpc_threadvar_relocate_proc,%rax
|
||||||
|
leaq Errno,%rbx
|
||||||
|
{$endif FPC_PIC}
|
||||||
testq %rax,%rax
|
testq %rax,%rax
|
||||||
jne .LThread
|
jne .LThread
|
||||||
movl %edx,Errno+8
|
movl %edx,8(%rbx)
|
||||||
jmp .LNoThread
|
jmp .LNoThread
|
||||||
.LThread:
|
.LThread:
|
||||||
pushq %rdx
|
pushq %rdx
|
||||||
movq Errno,%rdi
|
movq (%rbx),%rdi
|
||||||
call *%rax
|
call *%rax
|
||||||
popq %rdx
|
popq %rdx
|
||||||
movl %edx,(%rax)
|
movl %edx,(%rax)
|
||||||
@ -136,14 +164,21 @@ asm
|
|||||||
jnae .LSyscOK { Jump to error handler if error. }
|
jnae .LSyscOK { Jump to error handler if error. }
|
||||||
negq %rax
|
negq %rax
|
||||||
movq %rax,%rdx
|
movq %rax,%rdx
|
||||||
|
{$ifdef FPC_PIC}
|
||||||
|
movq fpc_threadvar_relocate_proc@GOTPCREL(%rip),%rax
|
||||||
|
movq (%rax),%rax
|
||||||
|
movq Errno@GOTPCREL(%rip),%rax
|
||||||
|
{$else FPC_PIC}
|
||||||
movq fpc_threadvar_relocate_proc,%rax
|
movq fpc_threadvar_relocate_proc,%rax
|
||||||
|
leaq Errno,%rbx
|
||||||
|
{$endif FPC_PIC}
|
||||||
testq %rax,%rax
|
testq %rax,%rax
|
||||||
jne .LThread
|
jne .LThread
|
||||||
movl %edx,Errno+8
|
movl %edx,8(%rbx)
|
||||||
jmp .LNoThread
|
jmp .LNoThread
|
||||||
.LThread:
|
.LThread:
|
||||||
pushq %rdx
|
pushq %rdx
|
||||||
movq Errno,%rdi
|
movq (%rbx),%rdi
|
||||||
call *%rax
|
call *%rax
|
||||||
popq %rdx
|
popq %rdx
|
||||||
movl %edx,(%rax)
|
movl %edx,(%rax)
|
||||||
@ -166,14 +201,21 @@ asm
|
|||||||
jnae .LSyscOK { Jump to error handler if error. }
|
jnae .LSyscOK { Jump to error handler if error. }
|
||||||
negq %rax
|
negq %rax
|
||||||
movq %rax,%rdx
|
movq %rax,%rdx
|
||||||
|
{$ifdef FPC_PIC}
|
||||||
|
movq fpc_threadvar_relocate_proc@GOTPCREL(%rip),%rax
|
||||||
|
movq (%rax),%rax
|
||||||
|
movq Errno@GOTPCREL(%rip),%rax
|
||||||
|
{$else FPC_PIC}
|
||||||
movq fpc_threadvar_relocate_proc,%rax
|
movq fpc_threadvar_relocate_proc,%rax
|
||||||
|
leaq Errno,%rbx
|
||||||
|
{$endif FPC_PIC}
|
||||||
testq %rax,%rax
|
testq %rax,%rax
|
||||||
jne .LThread
|
jne .LThread
|
||||||
movl %edx,Errno+8
|
movl %edx,8(%rbx)
|
||||||
jmp .LNoThread
|
jmp .LNoThread
|
||||||
.LThread:
|
.LThread:
|
||||||
pushq %rdx
|
pushq %rdx
|
||||||
movq Errno,%rdi
|
movq (%rbx),%rdi
|
||||||
call *%rax
|
call *%rax
|
||||||
popq %rdx
|
popq %rdx
|
||||||
movl %edx,(%rax)
|
movl %edx,(%rax)
|
||||||
@ -198,14 +240,21 @@ asm
|
|||||||
jnae .LSyscOK { Jump to error handler if error. }
|
jnae .LSyscOK { Jump to error handler if error. }
|
||||||
negq %rax
|
negq %rax
|
||||||
movq %rax,%rdx
|
movq %rax,%rdx
|
||||||
|
{$ifdef FPC_PIC}
|
||||||
|
movq fpc_threadvar_relocate_proc@GOTPCREL(%rip),%rax
|
||||||
|
movq (%rax),%rax
|
||||||
|
movq Errno@GOTPCREL(%rip),%rax
|
||||||
|
{$else FPC_PIC}
|
||||||
movq fpc_threadvar_relocate_proc,%rax
|
movq fpc_threadvar_relocate_proc,%rax
|
||||||
|
leaq Errno,%rbx
|
||||||
|
{$endif FPC_PIC}
|
||||||
testq %rax,%rax
|
testq %rax,%rax
|
||||||
jne .LThread
|
jne .LThread
|
||||||
movl %edx,Errno+8
|
movl %edx,8(%rbx)
|
||||||
jmp .LNoThread
|
jmp .LNoThread
|
||||||
.LThread:
|
.LThread:
|
||||||
pushq %rdx
|
pushq %rdx
|
||||||
movq Errno,%rdi
|
movq (%rbx),%rdi
|
||||||
call *%rax
|
call *%rax
|
||||||
popq %rdx
|
popq %rdx
|
||||||
movl %edx,(%rax)
|
movl %edx,(%rax)
|
||||||
@ -219,5 +268,3 @@ end;
|
|||||||
{$IFDEF SYS_LINUX}
|
{$IFDEF SYS_LINUX}
|
||||||
{$UNDEF SYSCALL_DEBUG}
|
{$UNDEF SYSCALL_DEBUG}
|
||||||
{$ENDIF SYS_LINUX}
|
{$ENDIF SYS_LINUX}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user