* fixes for nasm writer, resolves #38074

+ test

git-svn-id: trunk@47413 -
This commit is contained in:
florian 2020-11-13 21:39:16 +00:00
parent a4995e3852
commit bf7961a901
3 changed files with 28 additions and 4 deletions

1
.gitattributes vendored
View File

@ -18529,6 +18529,7 @@ tests/webtbs/tw38022.pp svneol=native#text/pascal
tests/webtbs/tw3805.pp svneol=native#text/plain
tests/webtbs/tw38051.pp svneol=native#text/pascal
tests/webtbs/tw38054.pp svneol=native#text/plain
tests/webtbs/tw38074.pp svneol=native#text/pascal
tests/webtbs/tw3814.pp svneol=native#text/plain
tests/webtbs/tw3827.pp svneol=native#text/plain
tests/webtbs/tw3829.pp svneol=native#text/plain

View File

@ -390,7 +390,7 @@ interface
begin
if (ops=1) and (opcode<>A_RET) then
writer.AsmWrite(sizestr(s,dest));
writer.AsmWrite(tostr(longint(o.val)));
writer.AsmWrite(tostr(o.val));
end;
top_ref :
begin
@ -634,8 +634,14 @@ interface
if target_info.system in systems_darwin then
writer.AsmWrite(':private_extern')
else
{ no colon }
writer.AsmWrite(' hidden')
case sym.typ of
AT_FUNCTION:
writer.AsmWrite(':function hidden');
AT_DATA:
writer.AsmWrite(':data hidden');
else
Internalerror(2020111301);
end;
end;
procedure TX86NasmAssembler.ResetSectionsList;
@ -1000,9 +1006,10 @@ interface
if tai_symbol(hp).is_global or SmartAsm then
begin
writer.AsmWrite(#9'GLOBAL ');
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name));
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name));
if tai_symbol(hp).sym.bind=AB_PRIVATE_EXTERN then
WriteHiddenSymbolAttribute(tai_symbol(hp).sym);
writer.AsmLn;
end;
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name));
if SmartAsm then

16
tests/webtbs/tw38074.pp Normal file
View File

@ -0,0 +1,16 @@
{ %cpu=x86_64 }
{ %opt=Anasm}
{$ASMMODE INTEL}
const
value : int64 =$1234567898765432;
function Test:Int64;assembler;
asm
mov RAX, $1234567898765432
end;
begin
if Test<>value then
halt(1);
writeln('ok');
end.