mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-09 22:06:08 +02:00
* Replaced some ifdef x86_64 by ifdef cpu64bitaddr, since it is more correct.
git-svn-id: trunk@13159 -
This commit is contained in:
parent
c0aa309cde
commit
bf00b3e94b
@ -62,9 +62,9 @@ interface
|
|||||||
bsize : longword;
|
bsize : longword;
|
||||||
entry : longword;
|
entry : longword;
|
||||||
text_start : longword;
|
text_start : longword;
|
||||||
{$ifndef x86_64}
|
{$ifndef cpu64bitaddr}
|
||||||
data_start : longword;
|
data_start : longword;
|
||||||
{$endif x86_64}
|
{$endif cpu64bitaddr}
|
||||||
ImageBase : aword;
|
ImageBase : aword;
|
||||||
SectionAlignment : longword;
|
SectionAlignment : longword;
|
||||||
FileAlignment : longword;
|
FileAlignment : longword;
|
||||||
@ -805,9 +805,9 @@ const pemagic : array[0..3] of byte = (
|
|||||||
address,
|
address,
|
||||||
relocval : aint;
|
relocval : aint;
|
||||||
relocsec : TObjSection;
|
relocsec : TObjSection;
|
||||||
{$ifdef x86_64}
|
{$ifdef cpu64bitaddr}
|
||||||
s : string;
|
s : string;
|
||||||
{$endif x86_64}
|
{$endif cpu64bitaddr}
|
||||||
begin
|
begin
|
||||||
if (ObjRelocations.Count>0) and
|
if (ObjRelocations.Count>0) and
|
||||||
not assigned(data) then
|
not assigned(data) then
|
||||||
@ -826,10 +826,10 @@ const pemagic : array[0..3] of byte = (
|
|||||||
data.Write(zero,4);
|
data.Write(zero,4);
|
||||||
continue;
|
continue;
|
||||||
end;
|
end;
|
||||||
{$ifdef x86_64}
|
{$ifdef cpu64bitaddr}
|
||||||
RELOC_ABSOLUTE:
|
RELOC_ABSOLUTE:
|
||||||
address_size:=8;
|
address_size:=8;
|
||||||
{$endif x86_64}
|
{$endif cpu64bitaddr}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
address:=0;
|
address:=0;
|
||||||
@ -944,7 +944,7 @@ const pemagic : array[0..3] of byte = (
|
|||||||
|
|
||||||
data.Seek(objreloc.dataoffset);
|
data.Seek(objreloc.dataoffset);
|
||||||
data.Write(address,address_size);
|
data.Write(address,address_size);
|
||||||
{$ifdef x86_64}
|
{$ifdef cpu64bitaddr}
|
||||||
if objreloc.typ = RELOC_ABSOLUTE32 then begin
|
if objreloc.typ = RELOC_ABSOLUTE32 then begin
|
||||||
if assigned(objreloc.symbol) then
|
if assigned(objreloc.symbol) then
|
||||||
s:=objreloc.symbol.Name
|
s:=objreloc.symbol.Name
|
||||||
@ -952,7 +952,7 @@ const pemagic : array[0..3] of byte = (
|
|||||||
s:=objreloc.objsection.Name;
|
s:=objreloc.objsection.Name;
|
||||||
Message2(link_w_32bit_absolute_reloc, ObjData.Name, s);
|
Message2(link_w_32bit_absolute_reloc, ObjData.Name, s);
|
||||||
end;
|
end;
|
||||||
{$endif x86_64}
|
{$endif cpu64bitaddr}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1066,13 +1066,13 @@ const pemagic : array[0..3] of byte = (
|
|||||||
CurrObjSec.addsectionreloc(curraddr,CurrObjSec,RELOC_ABSOLUTE);
|
CurrObjSec.addsectionreloc(curraddr,CurrObjSec,RELOC_ABSOLUTE);
|
||||||
inc(data,symaddr);
|
inc(data,symaddr);
|
||||||
end;
|
end;
|
||||||
{$ifdef x86_64}
|
{$ifdef cpu64bitaddr}
|
||||||
RELOC_ABSOLUTE32 :
|
RELOC_ABSOLUTE32 :
|
||||||
begin
|
begin
|
||||||
CurrObjSec.addsectionreloc(curraddr,CurrObjSec,RELOC_ABSOLUTE32);
|
CurrObjSec.addsectionreloc(curraddr,CurrObjSec,RELOC_ABSOLUTE32);
|
||||||
inc(data,symaddr);
|
inc(data,symaddr);
|
||||||
end;
|
end;
|
||||||
{$endif x86_64}
|
{$endif cpu64bitaddr}
|
||||||
RELOC_RELATIVE :
|
RELOC_RELATIVE :
|
||||||
begin
|
begin
|
||||||
inc(data,symaddr-len-CurrObjSec.Size);
|
inc(data,symaddr-len-CurrObjSec.Size);
|
||||||
@ -2269,9 +2269,9 @@ const pemagic : array[0..3] of byte = (
|
|||||||
if assigned(BSSExeSec) then
|
if assigned(BSSExeSec) then
|
||||||
peoptheader.bsize:=BSSExeSec.Size;
|
peoptheader.bsize:=BSSExeSec.Size;
|
||||||
peoptheader.text_start:=TextExeSec.mempos;
|
peoptheader.text_start:=TextExeSec.mempos;
|
||||||
{$ifndef x86_64}
|
{$ifndef cpu64bitaddr}
|
||||||
peoptheader.data_start:=DataExeSec.mempos;
|
peoptheader.data_start:=DataExeSec.mempos;
|
||||||
{$endif x86_64}
|
{$endif cpu64bitaddr}
|
||||||
peoptheader.entry:=EntrySym.Address;
|
peoptheader.entry:=EntrySym.Address;
|
||||||
peoptheader.ImageBase:=ImageBase;
|
peoptheader.ImageBase:=ImageBase;
|
||||||
peoptheader.SectionAlignment:=SectionMemAlign;
|
peoptheader.SectionAlignment:=SectionMemAlign;
|
||||||
@ -2670,7 +2670,7 @@ const pemagic : array[0..3] of byte = (
|
|||||||
for k:=0 to objsec.ObjRelocations.Count-1 do
|
for k:=0 to objsec.ObjRelocations.Count-1 do
|
||||||
begin
|
begin
|
||||||
objreloc:=TObjRelocation(objsec.ObjRelocations[k]);
|
objreloc:=TObjRelocation(objsec.ObjRelocations[k]);
|
||||||
if not (objreloc.typ in [{$ifdef x86_64}RELOC_ABSOLUTE32,{$endif x86_64}RELOC_ABSOLUTE]) then
|
if not (objreloc.typ in [{$ifdef cpu64bitaddr}RELOC_ABSOLUTE32,{$endif cpu64bitaddr}RELOC_ABSOLUTE]) then
|
||||||
continue;
|
continue;
|
||||||
offset:=objsec.MemPos+objreloc.dataoffset;
|
offset:=objsec.MemPos+objreloc.dataoffset;
|
||||||
if (offset<pgaddr) and (pgaddr<>longword(-1)) then
|
if (offset<pgaddr) and (pgaddr<>longword(-1)) then
|
||||||
@ -2684,11 +2684,11 @@ const pemagic : array[0..3] of byte = (
|
|||||||
{ Reserving space for block size. The size will be written later in FinishBlock }
|
{ Reserving space for block size. The size will be written later in FinishBlock }
|
||||||
internalObjData.writebytes(k,4);
|
internalObjData.writebytes(k,4);
|
||||||
end;
|
end;
|
||||||
{$ifdef x86_64}
|
{$ifdef cpu64bitaddr}
|
||||||
if objreloc.typ = RELOC_ABSOLUTE then
|
if objreloc.typ = RELOC_ABSOLUTE then
|
||||||
w:=IMAGE_REL_BASED_DIR64
|
w:=IMAGE_REL_BASED_DIR64
|
||||||
else
|
else
|
||||||
{$endif x86_64}
|
{$endif cpu64bitaddr}
|
||||||
w:=IMAGE_REL_BASED_HIGHLOW;
|
w:=IMAGE_REL_BASED_HIGHLOW;
|
||||||
w:=(w shl 12) or (offset-pgaddr);
|
w:=(w shl 12) or (offset-pgaddr);
|
||||||
internalObjData.writebytes(w,2);
|
internalObjData.writebytes(w,2);
|
||||||
|
Loading…
Reference in New Issue
Block a user