summaryrefslogtreecommitdiff
path: root/compiler/i386
diff options
context:
space:
mode:
authoryury <yury@3ad0048d-3df7-0310-abae-a5850022a9f2>2019-02-25 13:35:40 +0000
committeryury <yury@3ad0048d-3df7-0310-abae-a5850022a9f2>2019-02-25 13:35:40 +0000
commit1ce70abafeaaa9d2270a74beca651f29b035e11b (patch)
treeb220955c8231e539b9b3993af016b3db06662eaf /compiler/i386
parenta7c24f025e126eb0f94db2bd71536308aa1d1c48 (diff)
downloadfpc-1ce70abafeaaa9d2270a74beca651f29b035e11b.tar.gz
* Do not set pi_needs_got in current_procinfo.flags at the node level, since the GOT usage can only be estimated there. Instead set the pi_needs_got flag at places where the GOT register is accessed during the code generation. This eliminates generation of the unneeded initialization of the GOT register and fixes linker errors when the _GLOBAL_OFFSET_TABLE_ symbol is referenced but no actual GOT references are present.
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@41460 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/i386')
-rw-r--r--compiler/i386/cgcpu.pas4
-rw-r--r--compiler/i386/hlcgcpu.pas1
2 files changed, 1 insertions, 4 deletions
diff --git a/compiler/i386/cgcpu.pas b/compiler/i386/cgcpu.pas
index dacfaba87d..e82de6f076 100644
--- a/compiler/i386/cgcpu.pas
+++ b/compiler/i386/cgcpu.pas
@@ -261,10 +261,6 @@ unit cgcpu;
reference_reset_symbol(tmpref,dirref.symbol,0,sizeof(pint),[]);
tmpref.refaddr:=addr_pic;
tmpref.base:=current_procinfo.got;
-{$ifdef EXTDEBUG}
- if not (pi_needs_got in current_procinfo.flags) then
- Comment(V_warning,'pi_needs_got not included');
-{$endif EXTDEBUG}
include(current_procinfo.flags,pi_needs_got);
list.concat(taicpu.op_ref(A_PUSH,S_L,tmpref));
end
diff --git a/compiler/i386/hlcgcpu.pas b/compiler/i386/hlcgcpu.pas
index e975600ca0..748e36c828 100644
--- a/compiler/i386/hlcgcpu.pas
+++ b/compiler/i386/hlcgcpu.pas
@@ -198,6 +198,7 @@ implementation
{ Alloc EBX }
getcpuregister(list, NR_PIC_OFFSET_REG);
list.concat(taicpu.op_reg_reg(A_MOV,S_L,current_procinfo.got,NR_PIC_OFFSET_REG));
+ include(current_procinfo.flags,pi_needs_got);
end;
Result:=inherited a_call_name(list, pd, s, paras, forceresdef, weak);
{ Free EBX }