Merged revisions 2782 via svnmerge from

http://svn.freepascal.org/svn/fpc/branches/linker/compiler

........
r2782 | peter | 2006-03-06 10:59:35 +0100 (Mon, 06 Mar 2006) | 2 lines

  * fix arm compile

........

git-svn-id: trunk@2783 -
This commit is contained in:
peter 2006-03-06 10:00:14 +00:00
parent 48d7cfb2a5
commit f1976eda5c
2 changed files with 851 additions and 848 deletions

View File

@ -28,6 +28,7 @@ interface
uses
cclasses,globtype,globals,verbose,
aasmbase,aasmtai,
ogbase,
symtype,
cpubase,cpuinfo,cgbase,cgutils;
@ -198,7 +199,7 @@ uses
procedure ResetPass2;
function CheckIfValid:boolean;
function GetString:string;
function Pass1(offset:longint):longint;override;
function Pass1(objdata:TObjData):longint;override;
procedure Pass2(objdata:TObjData);override;
protected
procedure ppuloadoper(ppufile:tcompilerppufile;var o:toper);override;
@ -212,13 +213,13 @@ uses
LastInsOffset : longint; { need to be public to be reset }
insentry : PInsEntry;
function InsEnd:longint;
procedure create_ot;
procedure create_ot(objdata:TObjData);
function Matches(p:PInsEntry):longint;
function calcsize(p:PInsEntry):shortint;
procedure gencode(objdata:TObjData);
function NeedAddrPrefix(opidx:byte):boolean;
procedure Swapoperands;
function FindInsentry:boolean;
function FindInsentry(objdata:TObjData):boolean;
end;
tai_align = class(tai_align_abstract)
@ -937,7 +938,7 @@ implementation
end;
function taicpu.Pass1(offset:longint):longint;
function taicpu.Pass1(objdata:TObjData):longint;
var
ldr2op : array[PF_B..PF_T] of tasmop = (
A_LDRB,A_LDRSB,A_LDRBT,A_LDRH,A_LDRSH,A_LDRT);
@ -946,7 +947,7 @@ implementation
begin
Pass1:=0;
{ Save the old offset and set the new offset }
InsOffset:=Offset;
InsOffset:=ObjData.CurrObjSec.Size;
{ Error? }
if (Insentry=nil) and (InsSize=-1) then
exit;
@ -978,7 +979,7 @@ implementation
end;
{ Get InsEntry }
if FindInsEntry then
if FindInsEntry(objdata) then
begin
InsSize:=4;
LastInsOffset:=InsOffset;
@ -1025,10 +1026,11 @@ implementation
end;
procedure taicpu.create_ot;
procedure taicpu.create_ot(objdata:TObjData);
var
i,l,relsize : longint;
dummy : byte;
currsym : TObjSymbol;
begin
if ops=0 then
exit;
@ -1112,8 +1114,9 @@ implementation
else
begin
l:=ref^.offset;
if assigned(ref^.symbol) then
inc(l,ref^.symbol.address);
currsym:=ObjData.symbolref(ref^.symbol);
if assigned(currsym) then
inc(l,currsym.address);
relsize:=(InsOffset+2)-l;
if (relsize<-33554428) or (relsize>33554428) then
ot:=OT_IMM32
@ -1346,7 +1349,7 @@ implementation
end;
function taicpu.FindInsentry:boolean;
function taicpu.FindInsentry(objdata:TObjData):boolean;
var
i : longint;
begin
@ -1356,7 +1359,7 @@ implementation
if (Insentry=nil) or ((InsEntry^.flags and IF_PASS2)<>0) then
begin
{ create the .ot fields }
create_ot;
create_ot(objdata);
{ set the file postion }
aktfilepos:=fileinfo;
end