mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-11 15:29:43 +01:00
* missing recalculation of relative constant
* if aligntype=1 then no alignment fillsize guessing is required git-svn-id: trunk@8701 -
This commit is contained in:
parent
232efef956
commit
76b23821e1
@ -922,11 +922,16 @@ Implementation
|
|||||||
begin
|
begin
|
||||||
case hp.typ of
|
case hp.typ of
|
||||||
ait_align :
|
ait_align :
|
||||||
|
begin
|
||||||
|
if tai_align_abstract(hp).aligntype>1 then
|
||||||
begin
|
begin
|
||||||
{ always use the maximum fillsize in this pass to avoid possible
|
{ always use the maximum fillsize in this pass to avoid possible
|
||||||
short jumps to become out of range }
|
short jumps to become out of range }
|
||||||
Tai_align_abstract(hp).fillsize:=Tai_align_abstract(hp).aligntype;
|
Tai_align_abstract(hp).fillsize:=Tai_align_abstract(hp).aligntype;
|
||||||
ObjData.alloc(Tai_align_abstract(hp).fillsize);
|
ObjData.alloc(Tai_align_abstract(hp).fillsize);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Tai_align_abstract(hp).fillsize:=0;
|
||||||
end;
|
end;
|
||||||
ait_datablock :
|
ait_datablock :
|
||||||
begin
|
begin
|
||||||
@ -1000,12 +1005,15 @@ Implementation
|
|||||||
begin
|
begin
|
||||||
case hp.typ of
|
case hp.typ of
|
||||||
ait_align :
|
ait_align :
|
||||||
|
begin
|
||||||
|
if tai_align_abstract(hp).aligntype>1 then
|
||||||
begin
|
begin
|
||||||
{ here we must determine the fillsize which is used in pass2 }
|
{ here we must determine the fillsize which is used in pass2 }
|
||||||
Tai_align_abstract(hp).fillsize:=align(ObjData.CurrObjSec.Size,Tai_align_abstract(hp).aligntype)-
|
Tai_align_abstract(hp).fillsize:=align(ObjData.CurrObjSec.Size,Tai_align_abstract(hp).aligntype)-
|
||||||
ObjData.CurrObjSec.Size;
|
ObjData.CurrObjSec.Size;
|
||||||
ObjData.alloc(Tai_align_abstract(hp).fillsize);
|
ObjData.alloc(Tai_align_abstract(hp).fillsize);
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
ait_datablock :
|
ait_datablock :
|
||||||
begin
|
begin
|
||||||
if (oso_data in ObjData.CurrObjSec.secoptions) then
|
if (oso_data in ObjData.CurrObjSec.secoptions) then
|
||||||
@ -1085,6 +1093,8 @@ Implementation
|
|||||||
{$endif x86}
|
{$endif x86}
|
||||||
leblen : byte;
|
leblen : byte;
|
||||||
lebbuf : array[0..63] of byte;
|
lebbuf : array[0..63] of byte;
|
||||||
|
objsym,
|
||||||
|
objsymend : TObjSymbol;
|
||||||
begin
|
begin
|
||||||
{ main loop }
|
{ main loop }
|
||||||
while assigned(hp) do
|
while assigned(hp) do
|
||||||
@ -1132,6 +1142,15 @@ Implementation
|
|||||||
ObjData.writebytes(Tai_string(hp).str^,Tai_string(hp).len);
|
ObjData.writebytes(Tai_string(hp).str^,Tai_string(hp).len);
|
||||||
ait_const :
|
ait_const :
|
||||||
begin
|
begin
|
||||||
|
{ Recalculate relative symbols, addresses of forward references
|
||||||
|
can be changed in treepass1 }
|
||||||
|
if assigned(tai_const(hp).sym) and
|
||||||
|
assigned(tai_const(hp).endsym) then
|
||||||
|
begin
|
||||||
|
objsym:=Objdata.SymbolRef(tai_const(hp).sym);
|
||||||
|
objsymend:=Objdata.SymbolRef(tai_const(hp).endsym);
|
||||||
|
Tai_const(hp).value:=objsymend.address-objsym.address+Tai_const(hp).symofs;
|
||||||
|
end;
|
||||||
case tai_const(hp).consttype of
|
case tai_const(hp).consttype of
|
||||||
aitconst_64bit,
|
aitconst_64bit,
|
||||||
aitconst_32bit,
|
aitconst_32bit,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user