summaryrefslogtreecommitdiff
path: root/compiler/x86/aasmcpu.pas
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/x86/aasmcpu.pas')
-rw-r--r--compiler/x86/aasmcpu.pas10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/x86/aasmcpu.pas b/compiler/x86/aasmcpu.pas
index 43ed8b4fd2..41f57dad9d 100644
--- a/compiler/x86/aasmcpu.pas
+++ b/compiler/x86/aasmcpu.pas
@@ -3682,6 +3682,16 @@ implementation
end;
{$endif i386}
objdata.writereloc(data,len,p,Reloctype);
+{$ifdef x86_64}
+ { Computed offset is not yet correct for GOTPC relocation }
+ { RELOC_GOTPCREL, RELOC_REX_GOTPCRELX, RELOC_GOTPCRELX need special handling }
+ if assigned(p) and (RelocType in [RELOC_GOTPCREL, RELOC_REX_GOTPCRELX, RELOC_GOTPCRELX]) and
+ { These relocations seem to be used only for ELF
+ which always has relocs_use_addend set to true
+ so that it is the orgsize of the last relocation which needs to be fixed PM }
+ (insend<>objdata.CurrObjSec.size) then
+ dec(TObjRelocation(objdata.CurrObjSec.ObjRelocations.Last).orgsize,insend-objdata.CurrObjSec.size);
+{$endif}
end;