* handle GOT-relative loads in the assembler reader as reads of

sizeof(pint) bytes (mantis 23109)

git-svn-id: trunk@28789 -
This commit is contained in:
Jonas Maebe 2014-10-08 18:38:06 +00:00
parent edd96fc46b
commit 5c8ae259c4
3 changed files with 19 additions and 1 deletions

1
.gitattributes vendored
View File

@ -13923,6 +13923,7 @@ tests/webtbs/tw2300.pp svneol=native#text/plain
tests/webtbs/tw2305.pp svneol=native#text/plain
tests/webtbs/tw2306.pp svneol=native#text/plain
tests/webtbs/tw2307.pp svneol=native#text/plain
tests/webtbs/tw23109.pp svneol=native#text/plain
tests/webtbs/tw2311.pp svneol=native#text/plain
tests/webtbs/tw23130.pp svneol=native#text/pascal
tests/webtbs/tw23136.pp svneol=native#text/pascal

View File

@ -437,7 +437,11 @@ begin
memopsize := 0;
case operands[i].opr.typ of
OPR_LOCAL: memopsize := operands[i].opr.localvarsize * 8;
OPR_REFERENCE: memopsize := operands[i].opr.varsize * 8;
OPR_REFERENCE:
if operands[i].opr.ref.refaddr = addr_pic then
memopsize := sizeof(pint) * 8
else
memopsize := operands[i].opr.varsize * 8;
end;
if memopsize = 0 then memopsize := topsize2memsize[tx86operand(operands[i]).opsize];

13
tests/webtbs/tw23109.pp Normal file
View File

@ -0,0 +1,13 @@
{ %cpu=x86_64}
{ %opt=-Cg -vew }
var
global: boolean;
begin
asm
movq global@GOTPCREL(%rip), %rax
movb $1, (%rax)
end;
if not global then
halt(1);
end.