mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-05 10:46:19 +02:00
Override tcallnode.pass_1 for use of got for cdecl'ared functions (assuming it can be PIC code)
git-svn-id: trunk@21797 -
This commit is contained in:
parent
c53d07f741
commit
56b4977858
@ -26,10 +26,11 @@ unit ncpucall;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
ncgcal;
|
node, ncgcal;
|
||||||
|
|
||||||
type
|
type
|
||||||
tMIPSELcallnode = class(tcgcallnode)
|
tMIPSELcallnode = class(tcgcallnode)
|
||||||
|
function pass_1 : tnode; override;
|
||||||
procedure extra_call_code; override;
|
procedure extra_call_code; override;
|
||||||
procedure extra_post_call_code; override;
|
procedure extra_post_call_code; override;
|
||||||
end;
|
end;
|
||||||
@ -38,11 +39,20 @@ type
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
cpubase,
|
globtype,cpubase,procinfo,
|
||||||
aasmtai,aasmcpu,aasmdata,
|
aasmtai,aasmcpu,aasmdata,
|
||||||
paramgr,
|
paramgr,
|
||||||
ncal;
|
ncal;
|
||||||
|
|
||||||
|
function TMIPSELcallnode.pass_1 : tnode;
|
||||||
|
begin
|
||||||
|
pass_1 := inherited pass_1;
|
||||||
|
if assigned(current_procinfo) and
|
||||||
|
assigned(procdefinition) and
|
||||||
|
(procdefinition.proccalloption=pocall_cdecl) then
|
||||||
|
include(current_procinfo.flags,pi_needs_got);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure tMIPSELcallnode.extra_call_code;
|
procedure tMIPSELcallnode.extra_call_code;
|
||||||
begin
|
begin
|
||||||
{ MIPS functions should never modify the stack pointer
|
{ MIPS functions should never modify the stack pointer
|
||||||
|
Loading…
Reference in New Issue
Block a user