mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 01:39:27 +02:00
+ ogelf.pas: support relocation of type R_X86_64_32 which is apparently used by DWARF3 debug info.
git-svn-id: trunk@19258 -
This commit is contained in:
parent
962db07cf6
commit
6ee77d9088
@ -753,13 +753,17 @@ implementation
|
||||
if CurrObjSec.sectype in [sec_rodata,sec_bss,sec_threadvar] then
|
||||
internalerror(200408252);
|
||||
{$endif userodata}
|
||||
{ Using RELOC_RVA to map 32-bit RELOC_ABSOLUTE to R_X86_64_32
|
||||
(RELOC_ABSOLUTE maps to R_X86_64_32S) }
|
||||
if (reltype=RELOC_ABSOLUTE) and (len<>sizeof(pint)) then
|
||||
reltype:=RELOC_RVA;
|
||||
if assigned(p) then
|
||||
begin
|
||||
{ real address of the symbol }
|
||||
symaddr:=p.address;
|
||||
{ Local ObjSymbols can be resolved already or need a section reloc }
|
||||
if (p.bind=AB_LOCAL) and
|
||||
(reltype in [RELOC_RELATIVE,RELOC_ABSOLUTE{$ifdef x86_64},RELOC_ABSOLUTE32{$endif x86_64}]) then
|
||||
(reltype in [RELOC_RELATIVE,RELOC_ABSOLUTE{$ifdef x86_64},RELOC_ABSOLUTE32,RELOC_RVA{$endif x86_64}]) then
|
||||
begin
|
||||
{ For a reltype relocation in the same section the
|
||||
value can be calculated }
|
||||
@ -810,8 +814,10 @@ implementation
|
||||
relsym,
|
||||
reltyp : longint;
|
||||
relocsect : TObjSection;
|
||||
{$ifdef x86_64}
|
||||
tmp: aint;
|
||||
asize: longint;
|
||||
{$endif x86_64}
|
||||
begin
|
||||
with elf32data do
|
||||
begin
|
||||
@ -869,6 +875,8 @@ implementation
|
||||
reltyp:=R_X86_64_64;
|
||||
RELOC_ABSOLUTE32 :
|
||||
reltyp:=R_X86_64_32S;
|
||||
RELOC_RVA :
|
||||
reltyp:=R_X86_64_32;
|
||||
RELOC_GOTPCREL :
|
||||
begin
|
||||
reltyp:=R_X86_64_GOTPCREL;
|
||||
|
Loading…
Reference in New Issue
Block a user