fpc/tests/webtbf/tw22665a.pp
Jonas Maebe 4d0e4e1b56 * treat "[var + rip]" in intel assembler mode as addr_pic_no_got on x86-64
(mantis )
  + support "[var wrt ..gotpcrel]" nasm/yasm syntax in intel assembler mode
    for GOT-relative accesses on x86-64, + give an error when trying to do
    this on win64 (it doesn't have a GOT)
  * moved code that give a warning when using GOT-relative accesses to
    static data on x86-64 from the AT&T reader to rax86 so it's also
    active for the Intel assembler reader
  + added warning when not using GOT-relative accesses (but plain
    RIP-relative instead) to global data on non-Win64 x86-64

git-svn-id: trunk@22243 -
2012-08-25 15:12:49 +00:00

23 lines
296 B
ObjectPascal

{ %target=win64 }
{ %cpu=x86_64 }
{ %fail }
{$asmmode intel}
var
val: qword;
Function Test: QWord; Assembler; NoStackFrame;
Asm
{ win64 doesn't support a GOT }
mov RAX, [val wrt ..gotpcrel]
mov RAX, [RAX]
End;
BEGIN
Val := $12345678901;
if test<>$12345678901 then
halt(1);
END.