mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-08 05:19:14 +02:00
From patch submitted by Willibald Krenn in Bug Report 17500.
* assemble.pas (TInternalAssembler.WriteStab): Use RELOC_ABSOLUTE32 for 32-bit stab entry. * ogcoff.pas: Add check for correct generated reloc section size. * systems/t_win.pas: Use 0x400000 image base for x86_64 programs using stabs debug information format. git-svn-id: trunk@16056 -
This commit is contained in:
parent
7199ac4ad7
commit
7c04d8d13b
@ -899,7 +899,7 @@ Implementation
|
|||||||
oldsec:=ObjData.CurrObjSec;
|
oldsec:=ObjData.CurrObjSec;
|
||||||
ObjData.SetSection(ObjData.StabsSec);
|
ObjData.SetSection(ObjData.StabsSec);
|
||||||
ObjData.Writebytes(stab,sizeof(TObjStabEntry)-4);
|
ObjData.Writebytes(stab,sizeof(TObjStabEntry)-4);
|
||||||
ObjData.Writereloc(stab.nvalue,4,relocsym,RELOC_ABSOLUTE);
|
ObjData.Writereloc(stab.nvalue,4,relocsym,RELOC_ABSOLUTE32);
|
||||||
ObjData.setsection(oldsec);
|
ObjData.setsection(oldsec);
|
||||||
end;
|
end;
|
||||||
if assigned(pendquote) then
|
if assigned(pendquote) then
|
||||||
|
@ -959,15 +959,19 @@ 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 cpu64bitaddr}
|
{$ifdef cpu64bitaddr}
|
||||||
if objreloc.typ = RELOC_ABSOLUTE32 then begin
|
if (objreloc.typ = RELOC_ABSOLUTE32) and (name <> '.stab') then
|
||||||
if assigned(objreloc.symbol) then
|
begin
|
||||||
s:=objreloc.symbol.Name
|
if assigned(objreloc.symbol) then
|
||||||
else
|
s:=objreloc.symbol.Name
|
||||||
s:=objreloc.objsection.Name;
|
else
|
||||||
Message2(link_w_32bit_absolute_reloc, ObjData.Name, s);
|
s:=objreloc.objsection.Name;
|
||||||
end;
|
Message2(link_w_32bit_absolute_reloc, ObjData.Name, s);
|
||||||
|
end;
|
||||||
{$endif cpu64bitaddr}
|
{$endif cpu64bitaddr}
|
||||||
end;
|
end;
|
||||||
|
{for size = 0 data is not valid PM }
|
||||||
|
if assigned(data) and (data.size <> size) then
|
||||||
|
internalerror(2010092801);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1089,7 +1093,8 @@ const pemagic : array[0..3] of byte = (
|
|||||||
{$endif cpu64bitaddr}
|
{$endif cpu64bitaddr}
|
||||||
RELOC_RELATIVE :
|
RELOC_RELATIVE :
|
||||||
begin
|
begin
|
||||||
inc(data,symaddr-len-CurrObjSec.Size);
|
//inc(data,symaddr-len-CurrObjSec.Size);
|
||||||
|
data:=data+symaddr-len-CurrObjSec.Size;
|
||||||
end;
|
end;
|
||||||
RELOC_RVA :
|
RELOC_RVA :
|
||||||
begin
|
begin
|
||||||
|
@ -969,7 +969,14 @@ implementation
|
|||||||
if target_info.system in systems_wince then
|
if target_info.system in systems_wince then
|
||||||
imagebase:=$10000
|
imagebase:=$10000
|
||||||
else
|
else
|
||||||
imagebase:={$ifdef cpu64bitaddr} $100000000 {$else} $400000 {$endif};
|
{$ifdef cpu64bitaddr}
|
||||||
|
if (paratargetdbg = dbg_stabs) then
|
||||||
|
imagebase:=$400000
|
||||||
|
else
|
||||||
|
imagebase:= $100000000;
|
||||||
|
{$else}
|
||||||
|
imagebase:=$400000;
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
Concat('IMAGEBASE $' + hexStr(imagebase, SizeOf(imagebase)*2));
|
Concat('IMAGEBASE $' + hexStr(imagebase, SizeOf(imagebase)*2));
|
||||||
Concat('HEADER');
|
Concat('HEADER');
|
||||||
|
Loading…
Reference in New Issue
Block a user