mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 20:09:27 +02:00
* Xtensa: fix txtensanodeutils.insert_init_final_table for the windowed abi
git-svn-id: trunk@44376 -
This commit is contained in:
parent
523ebb42cf
commit
28154cebd1
@ -33,7 +33,7 @@ interface
|
|||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
tavrnodeutils = class(tnodeutils)
|
txtensanodeutils = class(tnodeutils)
|
||||||
protected
|
protected
|
||||||
class procedure insert_init_final_table(entries:tfplist); override;
|
class procedure insert_init_final_table(entries:tfplist); override;
|
||||||
end;
|
end;
|
||||||
@ -52,7 +52,7 @@ implementation
|
|||||||
pass_1;
|
pass_1;
|
||||||
|
|
||||||
|
|
||||||
class procedure tavrnodeutils.insert_init_final_table(entries:tfplist);
|
class procedure txtensanodeutils.insert_init_final_table(entries:tfplist);
|
||||||
var
|
var
|
||||||
op : TAsmOp;
|
op : TAsmOp;
|
||||||
initList, finalList, header: TAsmList;
|
initList, finalList, header: TAsmList;
|
||||||
@ -71,10 +71,21 @@ implementation
|
|||||||
initList.Concat(taicpu.op_sym(A_CALL0,current_asmdata.RefAsmSymbol(entry^.initfunc,AT_FUNCTION)));
|
initList.Concat(taicpu.op_sym(A_CALL0,current_asmdata.RefAsmSymbol(entry^.initfunc,AT_FUNCTION)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
case target_info.abi of
|
||||||
|
abi_xtensa_call0:
|
||||||
|
begin
|
||||||
initList.Concat(taicpu.op_none(A_RET));
|
initList.Concat(taicpu.op_none(A_RET));
|
||||||
finalList.Concat(taicpu.op_none(A_RET));
|
finalList.Concat(taicpu.op_none(A_RET));
|
||||||
|
end;
|
||||||
|
abi_xtensa_windowed:
|
||||||
begin
|
begin
|
||||||
|
initList.Concat(taicpu.op_none(A_RETW));
|
||||||
|
finalList.Concat(taicpu.op_none(A_RETW));
|
||||||
|
end;
|
||||||
|
else
|
||||||
|
Internalerror(2020031410);
|
||||||
|
end;
|
||||||
|
|
||||||
header:=TAsmList.create;
|
header:=TAsmList.create;
|
||||||
new_section(header, sec_code, 'FPC_INIT_FUNC_TABLE', 1);
|
new_section(header, sec_code, 'FPC_INIT_FUNC_TABLE', 1);
|
||||||
header.concat(tai_symbol.Createname_global('FPC_INIT_FUNC_TABLE',AT_FUNCTION,0,voidcodepointertype));
|
header.concat(tai_symbol.Createname_global('FPC_INIT_FUNC_TABLE',AT_FUNCTION,0,voidcodepointertype));
|
||||||
@ -83,9 +94,7 @@ implementation
|
|||||||
header.free;
|
header.free;
|
||||||
|
|
||||||
current_asmdata.AsmLists[al_procedures].concatList(initList);
|
current_asmdata.AsmLists[al_procedures].concatList(initList);
|
||||||
end;
|
|
||||||
|
|
||||||
begin
|
|
||||||
header:=TAsmList.create;
|
header:=TAsmList.create;
|
||||||
new_section(header, sec_code, 'FPC_FINALIZE_FUNC_TABLE', 1);
|
new_section(header, sec_code, 'FPC_FINALIZE_FUNC_TABLE', 1);
|
||||||
header.concat(tai_symbol.Createname_global('FPC_FINALIZE_FUNC_TABLE',AT_FUNCTION,0,voidcodepointertype));
|
header.concat(tai_symbol.Createname_global('FPC_FINALIZE_FUNC_TABLE',AT_FUNCTION,0,voidcodepointertype));
|
||||||
@ -94,7 +103,6 @@ implementation
|
|||||||
header.free;
|
header.free;
|
||||||
|
|
||||||
current_asmdata.AsmLists[al_procedures].concatList(finalList);
|
current_asmdata.AsmLists[al_procedures].concatList(finalList);
|
||||||
end;
|
|
||||||
|
|
||||||
initList.Free;
|
initList.Free;
|
||||||
finalList.Free;
|
finalList.Free;
|
||||||
@ -103,6 +111,6 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
cnodeutils:=tavrnodeutils;
|
cnodeutils:=txtensanodeutils;
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user