From 2c43e084f03ca02fc646e1f15566865f987e523f Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sat, 25 Aug 2012 15:12:44 +0000 Subject: [PATCH] * disabled "[reg].offset globalvar" pic syntax in intel assembler mode for x86-64, because it does not specify whether the code should be got-based or not git-svn-id: trunk@22242 - --- compiler/x86/rax86int.pas | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compiler/x86/rax86int.pas b/compiler/x86/rax86int.pas index e5536a1083..21e1439f83 100644 --- a/compiler/x86/rax86int.pas +++ b/compiler/x86/rax86int.pas @@ -1626,6 +1626,14 @@ Unit Rax86int; begin case oper.opr.typ of OPR_REFERENCE : +{$ifndef x86_64} + { this is for the i386 scenario where you have + + mov eax, [ebx].offset globalvar + + x86-64 uses RIP-based addresses (both for GOT and non-GOT + relative accesses) + } if (actasmtoken=AS_OFFSET) and (cs_create_pic in current_settings.moduleswitches) then begin @@ -1634,6 +1642,7 @@ Unit Rax86int; BuildOperand(oper,false); end else +{$endif x86_64} inc(oper.opr.ref.offset,BuildRefConstExpression); OPR_LOCAL : inc(oper.opr.localsymofs,BuildConstExpression);