* Fixed internal assembler writer to handle offset calculations with forward symbols involved. Internal assembler can handle dwarf debug info now.

git-svn-id: trunk@13096 -
This commit is contained in:
yury 2009-05-04 11:19:48 +00:00
parent 99917e034d
commit b1427bad2e

View File

@ -971,12 +971,17 @@ Implementation
if assigned(tai_const(hp).sym) then if assigned(tai_const(hp).sym) then
begin begin
objsym:=Objdata.SymbolRef(tai_const(hp).sym); objsym:=Objdata.SymbolRef(tai_const(hp).sym);
if assigned(tai_const(hp).endsym) then { objsym already defined and there is endsym? }
if assigned(objsym.objsection) and assigned(tai_const(hp).endsym) then
begin begin
objsymend:=Objdata.SymbolRef(tai_const(hp).endsym); objsymend:=Objdata.SymbolRef(tai_const(hp).endsym);
if objsymend.objsection<>objsym.objsection then { objsymend already defined? }
internalerror(200404124); if assigned(objsymend.objsection) then
Tai_const(hp).value:=objsymend.address-objsym.address+Tai_const(hp).symofs; begin
if objsymend.objsection<>objsym.objsection then
internalerror(200404124);
Tai_const(hp).value:=objsymend.address-objsym.address+Tai_const(hp).symofs;
end;
end; end;
end; end;
ObjData.alloc(tai_const(hp).size); ObjData.alloc(tai_const(hp).size);
@ -1058,12 +1063,14 @@ Implementation
ObjData.alloc(8); ObjData.alloc(8);
ait_const: ait_const:
begin begin
{ Recalculate relative symbols, all checks are done in treepass0 } { Recalculate relative symbols }
if assigned(tai_const(hp).sym) and if assigned(tai_const(hp).sym) and
assigned(tai_const(hp).endsym) then assigned(tai_const(hp).endsym) then
begin begin
objsym:=Objdata.SymbolRef(tai_const(hp).sym); objsym:=Objdata.SymbolRef(tai_const(hp).sym);
objsymend:=Objdata.SymbolRef(tai_const(hp).endsym); objsymend:=Objdata.SymbolRef(tai_const(hp).endsym);
if objsymend.objsection<>objsym.objsection then
internalerror(200905042);
Tai_const(hp).value:=objsymend.address-objsym.address+Tai_const(hp).symofs; Tai_const(hp).value:=objsymend.address-objsym.address+Tai_const(hp).symofs;
end; end;
ObjData.alloc(tai_const(hp).size); ObjData.alloc(tai_const(hp).size);