mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-16 02:30:41 +01:00
* Fixed a bug introduced in r23077: relative_reloc_count must be increased only once per GOT entry, not every time a relocation to that entry is seen.
git-svn-id: trunk@23126 -
This commit is contained in:
parent
4ab7c432c0
commit
a771d68685
@ -244,7 +244,7 @@ interface
|
||||
dynreloclist: TFPObjectList;
|
||||
tlsseg: TElfSegment;
|
||||
relative_reloc_count: longint;
|
||||
procedure AllocGOTSlot(objsym: TObjSymbol);
|
||||
function AllocGOTSlot(objsym: TObjSymbol):boolean;
|
||||
procedure WriteDynRelocEntry(dataofs:aword;typ:byte;symidx:aword;addend:aword);
|
||||
procedure WriteFirstPLTEntry;virtual;abstract;
|
||||
procedure WritePLTEntry(exesym:TExeSymbol);virtual;
|
||||
@ -1994,10 +1994,11 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
procedure TElfExeOutput.AllocGOTSlot(objsym:TObjSymbol);
|
||||
function TElfExeOutput.AllocGOTSlot(objsym:TObjSymbol):boolean;
|
||||
var
|
||||
exesym: TExeSymbol;
|
||||
begin
|
||||
result:=false;
|
||||
exesym:=objsym.exesymbol;
|
||||
|
||||
{ Although local symbols should not be accessed through GOT,
|
||||
@ -2019,6 +2020,7 @@ implementation
|
||||
only the latter applies. }
|
||||
if IsSharedLibrary or (exesym.dynindex>0) then
|
||||
dynrelocsec.alloc(dynrelocsec.shentsize);
|
||||
result:=true;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@ -241,9 +241,9 @@ implementation
|
||||
R_X86_64_GOTPCREL,
|
||||
R_X86_64_GOTPCREL64:
|
||||
begin
|
||||
AllocGOTSlot(objreloc.symbol);
|
||||
if IsSharedLibrary and (objreloc.symbol.exesymbol.dynindex=0) then
|
||||
Inc(relative_reloc_count);
|
||||
if AllocGOTSlot(objreloc.symbol) then
|
||||
if IsSharedLibrary and (objreloc.symbol.exesymbol.dynindex=0) then
|
||||
Inc(relative_reloc_count);
|
||||
end;
|
||||
|
||||
//R_X86_64_TLSGD,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user