mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 20:28:49 +02:00
+ implementation of lazy binding for linux
git-svn-id: trunk@1750 -
This commit is contained in:
parent
238510c59d
commit
72d7597edc
@ -192,7 +192,8 @@ unit cgobj;
|
||||
registers used for the parameters (PFV)
|
||||
}
|
||||
procedure a_call_name(list : taasmoutput;const s : string);virtual; abstract;
|
||||
procedure a_call_reg(list : taasmoutput;reg : tregister);virtual;abstract;
|
||||
procedure a_call_reg(list : taasmoutput;reg : tregister);virtual; abstract;
|
||||
procedure a_call_ref(list : taasmoutput;ref : treference);virtual; abstract;
|
||||
|
||||
{ move instructions }
|
||||
procedure a_load_const_reg(list : taasmoutput;size : tcgsize;a : aint;register : tregister);virtual; abstract;
|
||||
|
@ -794,14 +794,15 @@ implementation
|
||||
|
||||
procedure tcgcallnode.pass_2;
|
||||
var
|
||||
regs_to_save_int,
|
||||
regs_to_save_fpu,
|
||||
regs_to_save_mm : Tcpuregisterset;
|
||||
href : treference;
|
||||
pop_size : longint;
|
||||
pvreg,
|
||||
vmtreg : tregister;
|
||||
oldaktcallnode : tcallnode;
|
||||
regs_to_save_int,
|
||||
regs_to_save_fpu,
|
||||
regs_to_save_mm : Tcpuregisterset;
|
||||
href : treference;
|
||||
pop_size : longint;
|
||||
pvreg,
|
||||
vmtreg : tregister;
|
||||
oldaktcallnode : tcallnode;
|
||||
sym : tasmsymbol;
|
||||
begin
|
||||
if not assigned(procdefinition) or
|
||||
not procdefinition.has_paraloc_info then
|
||||
@ -933,7 +934,19 @@ implementation
|
||||
if (po_interrupt in procdefinition.procoptions) then
|
||||
extra_interrupt_code;
|
||||
extra_call_code;
|
||||
cg.a_call_name(exprasmlist,tprocdef(procdefinition).mangledname);
|
||||
|
||||
{ lazy binding on linux? }
|
||||
if (target_info.system in system_linux) and
|
||||
assigned(tprocdef(procdefinition).import_dll) and
|
||||
(tprocdef(procdefinition).import_dll^='') then
|
||||
begin
|
||||
sym:=objectlibrary.newasmsymbol(tprocdef(procdefinition).mangledname,AB_EXTERNAL,AT_FUNCTION);
|
||||
reference_reset_symbol(href,sym,0);
|
||||
href.refaddr:=addr_pic;
|
||||
cg.a_call_ref(exprasmlist,href);
|
||||
end
|
||||
else
|
||||
cg.a_call_name(exprasmlist,tprocdef(procdefinition).mangledname);
|
||||
extra_post_call_code;
|
||||
end;
|
||||
end;
|
||||
|
@ -54,6 +54,7 @@ unit cgx86;
|
||||
|
||||
procedure a_call_name(list : taasmoutput;const s : string);override;
|
||||
procedure a_call_reg(list : taasmoutput;reg : tregister);override;
|
||||
procedure a_call_ref(list : taasmoutput;ref : treference);override;
|
||||
|
||||
procedure a_op_const_reg(list : taasmoutput; Op: TOpCG; size: TCGSize; a: aint; reg: TRegister); override;
|
||||
procedure a_op_const_ref(list : taasmoutput; Op: TOpCG; size: TCGSize; a: aint; const ref: TReference); override;
|
||||
@ -556,6 +557,12 @@ unit cgx86;
|
||||
end;
|
||||
|
||||
|
||||
procedure tcgx86.a_call_ref(list : taasmoutput;ref : treference);
|
||||
begin
|
||||
list.concat(taicpu.op_ref(A_CALL,S_NO,ref));
|
||||
end;
|
||||
|
||||
|
||||
{********************** load instructions ********************}
|
||||
|
||||
procedure tcgx86.a_load_const_reg(list : taasmoutput; tosize: TCGSize; a : aint; reg : TRegister);
|
||||
@ -824,7 +831,7 @@ unit cgx86;
|
||||
A_MOVSS,
|
||||
A_MOVSD,
|
||||
A_MOVQ:
|
||||
add_move_instruction(instr);
|
||||
add_move_instruction(instr);
|
||||
end;
|
||||
list.concat(instr);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user