m68k: made the PIC_OFFSET_REGs runtime changeable, and applied some defaults

git-svn-id: trunk@37895 -
This commit is contained in:
Károly Balogh 2018-01-04 07:50:50 +00:00
parent ae1b005b1a
commit 58d98d8cd7
2 changed files with 9 additions and 3 deletions

View File

@ -268,7 +268,8 @@ unit cpubase;
NR_STACK_POINTER_REG = NR_SP;
RS_STACK_POINTER_REG = RS_SP;
{# Frame pointer register }
{ Frame pointer register (initialized in tcpuprocinfo.init_framepointer) }
{ Frame pointer register (initialized in tcpuprocinfo.init_framepointer) }
RS_FRAME_POINTER_REG: tsuperregister = RS_NO;
NR_FRAME_POINTER_REG: tregister = NR_NO;
@ -276,8 +277,9 @@ unit cpubase;
such as in PIC code. The exact meaning is ABI specific. For
further information look at GCC source : PIC_OFFSET_TABLE_REGNUM
}
{ TODO: FIX ME!!! pic offset reg conflicts with frame pointer?}
NR_PIC_OFFSET_REG = NR_A5;
RS_PIC_OFFSET_REG: tsuperregister = RS_NO;
NR_PIC_OFFSET_REG: tregister = NR_NO;
{ Return address for DWARF }
NR_RETURN_ADDRESS_REG = NR_A0;
RS_RETURN_ADDRESS_REG = RS_A0;

View File

@ -50,11 +50,15 @@ unit cpupi;
begin
RS_FRAME_POINTER_REG:=RS_A6;
NR_FRAME_POINTER_REG:=NR_A6;
RS_PIC_OFFSET_REG:=RS_A5;
NR_PIC_OFFSET_REG:=NR_A5;
end
else
begin
NR_FRAME_POINTER_REG:=NR_A5;
RS_FRAME_POINTER_REG:=RS_A5;
RS_PIC_OFFSET_REG:=RS_A4;
NR_PIC_OFFSET_REG:=NR_A4;
end;
end;