summaryrefslogtreecommitdiff
path: root/compiler/ogelf.pas
diff options
context:
space:
mode:
authorsergei <sergei@3ad0048d-3df7-0310-abae-a5850022a9f2>2012-12-09 06:39:43 +0000
committersergei <sergei@3ad0048d-3df7-0310-abae-a5850022a9f2>2012-12-09 06:39:43 +0000
commitb9db7732488aeb295cd0904367665b706d22d982 (patch)
tree28b506994606e91d720f23527d257f288b759b18 /compiler/ogelf.pas
parent273796eb82a22abe311421c478c93f2e490a37da (diff)
downloadfpc-b9db7732488aeb295cd0904367665b706d22d982.tar.gz
* 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: http://svn.freepascal.org/svn/fpc/trunk@23126 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/ogelf.pas')
-rw-r--r--compiler/ogelf.pas6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/ogelf.pas b/compiler/ogelf.pas
index ddcfd8f482..cb2c4ea341 100644
--- a/compiler/ogelf.pas
+++ b/compiler/ogelf.pas
@@ -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;