* Use RIP relative symbol addressing in assembler blocks. Finally bug #13657 is fixed.

git-svn-id: trunk@13137 -
This commit is contained in:
yury 2009-05-13 10:45:54 +00:00
parent 82ad6b4de9
commit bba2b87064
3 changed files with 16 additions and 12 deletions

View File

@ -405,7 +405,11 @@ procedure Exe_entry;[public,alias:'_FPC_EXE_Entry'];
asm
xorl %rax,%rax
movw %ss,%ax
{$ifdef FPC_HAS_RIP_RELATIVE}
movl %eax,_SS(%rip)
{$else}
movl %eax,_SS
{$endif}
xorl %rbp,%rbp
call PASCALMAIN
popq %rbp

View File

@ -45,9 +45,9 @@ FPC_ABSMASK_DOUBLE:
fnclex
fldcw (%rdx)
{$else FPC_PIC}
movw %ax,default8087cw
movw %ax,default8087cw{$ifdef FPC_HAS_RIP_RELATIVE}(%rip){$endif}
fnclex
fldcw default8087cw
fldcw default8087cw{$ifdef FPC_HAS_RIP_RELATIVE}(%rip){$endif}
{$endif FPC_PIC}
end;

View File

@ -266,7 +266,7 @@ function declocked(var l : longint) : boolean;assembler;
}
{ this check should be done because a lock takes a lot }
{ of time! }
cmpb $0,IsMultithread
cmpb $0,IsMultithread{$ifdef FPC_HAS_RIP_RELATIVE}(%rip){$endif}
jz .Ldeclockednolock
lock
decl (%rcx)
@ -285,7 +285,7 @@ function declocked(var l : longint) : boolean;assembler;
movq IsMultithread@GOTPCREL(%rip),%rax
cmpb $0,(%rax)
{$else FPC_PIC}
cmpb $0,IsMultithread
cmpb $0,IsMultithread{$ifdef FPC_HAS_RIP_RELATIVE}(%rip){$endif}
{$endif FPC_PIC}
jz .Ldeclockednolock
lock
@ -308,7 +308,7 @@ function declocked(var l : int64) : boolean;assembler;
}
{ this check should be done because a lock takes a lot }
{ of time! }
cmpb $0,IsMultithread
cmpb $0,IsMultithread{$ifdef FPC_HAS_RIP_RELATIVE}(%rip){$endif}
jz .Ldeclockednolock
lock
decq (%rcx)
@ -327,7 +327,7 @@ function declocked(var l : int64) : boolean;assembler;
movq IsMultithread@GOTPCREL(%rip),%rax
cmpb $0,(%rax)
{$else FPC_PIC}
cmpb $0,IsMultithread
cmpb $0,IsMultithread{$ifdef FPC_HAS_RIP_RELATIVE}(%rip){$endif}
{$endif FPC_PIC}
jz .Ldeclockednolock
lock
@ -351,7 +351,7 @@ procedure inclocked(var l : longint);assembler;
}
{ this check should be done because a lock takes a lot }
{ of time! }
cmpb $0,IsMultithread
cmpb $0,IsMultithread{$ifdef FPC_HAS_RIP_RELATIVE}(%rip){$endif}
jz .Linclockednolock
lock
incl (%rcx)
@ -369,7 +369,7 @@ procedure inclocked(var l : longint);assembler;
movq IsMultithread@GOTPCREL(%rip),%rax
cmpb $0,(%rax)
{$else FPC_PIC}
cmpb $0,IsMultithread
cmpb $0,IsMultithread{$ifdef FPC_HAS_RIP_RELATIVE}(%rip){$endif}
{$endif FPC_PIC}
jz .Linclockednolock
lock
@ -392,7 +392,7 @@ procedure inclocked(var l : int64);assembler;
}
{ this check should be done because a lock takes a lot }
{ of time! }
cmpb $0,IsMultithread
cmpb $0,IsMultithread{$ifdef FPC_HAS_RIP_RELATIVE}(%rip){$endif}
jz .Linclockednolock
lock
incq (%rcx)
@ -410,7 +410,7 @@ procedure inclocked(var l : int64);assembler;
movq IsMultithread@GOTPCREL(%rip),%rax
cmpb $0,(%rax)
{$else FPC_PIC}
cmpb $0,IsMultithread
cmpb $0,IsMultithread{$ifdef FPC_HAS_RIP_RELATIVE}(%rip){$endif}
{$endif FPC_PIC}
jz .Linclockednolock
lock
@ -604,9 +604,9 @@ begin
movq mxcsr@GOTPCREL(%rip),%rax
ldmxcsr (%rax)
{$else FPC_PIC}
fldcw fpucw
fldcw fpucw{$ifdef FPC_HAS_RIP_RELATIVE}(%rip){$endif}
{ set sse exceptions }
ldmxcsr mxcsr
ldmxcsr mxcsr{$ifdef FPC_HAS_RIP_RELATIVE}(%rip){$endif}
{$endif FPC_PIC}
end ['RAX'];
{ x86-64 might use softfloat code }