mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-01 20:46:06 +02:00
* arm thumb: allow interface trampolines to non-virtual methods with large offsets
git-svn-id: trunk@24434 -
This commit is contained in:
parent
1682e9a2b1
commit
7bea00e5fb
@ -3035,6 +3035,8 @@ unit cgcpu;
|
||||
|
||||
var
|
||||
make_global : boolean;
|
||||
tmpref : treference;
|
||||
l : TAsmLabel;
|
||||
begin
|
||||
if not(procdef.proctypeoption in [potype_function,potype_procedure]) then
|
||||
Internalerror(200006137);
|
||||
@ -3071,6 +3073,27 @@ unit cgcpu;
|
||||
op_onr12methodaddr;
|
||||
end
|
||||
{ case 0 }
|
||||
else if current_settings.cputype in cpu_thumb then
|
||||
begin
|
||||
{ bl cannot be used here because it destroys lr }
|
||||
|
||||
list.concat(taicpu.op_regset(A_PUSH,R_INTREGISTER,R_SUBWHOLE,[RS_R0]));
|
||||
|
||||
{ create consts entry }
|
||||
reference_reset(tmpref,4);
|
||||
current_asmdata.getjumplabel(l);
|
||||
current_procinfo.aktlocaldata.Concat(tai_align.Create(4));
|
||||
cg.a_label(current_procinfo.aktlocaldata,l);
|
||||
tmpref.symboldata:=current_procinfo.aktlocaldata.last;
|
||||
current_procinfo.aktlocaldata.concat(tai_const.Create_sym(current_asmdata.RefAsmSymbol(procdef.mangledname)));
|
||||
|
||||
tmpref.symbol:=l;
|
||||
tmpref.base:=NR_PC;
|
||||
cg.a_load_ref_reg(list,OS_ADDR,OS_ADDR,tmpref,NR_R0);
|
||||
list.concat(taicpu.op_reg_reg(A_MOV,NR_R12,NR_R0));
|
||||
list.concat(taicpu.op_regset(A_POP,R_INTREGISTER,R_SUBWHOLE,[RS_R0]));
|
||||
list.concat(taicpu.op_reg_reg(A_MOV,NR_PC,NR_R12));
|
||||
end
|
||||
else
|
||||
list.concat(taicpu.op_sym(A_B,current_asmdata.RefAsmSymbol(procdef.mangledname)));
|
||||
list.concatlist(current_procinfo.aktlocaldata);
|
||||
|
Loading…
Reference in New Issue
Block a user