mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 12:29:14 +02:00
+ use ApplyAsmSymbolRestrictions on all symbols in the NASM writer
git-svn-id: trunk@45308 -
This commit is contained in:
parent
fc5c35362b
commit
4d428d945e
@ -341,7 +341,7 @@ interface
|
||||
{$endif x86_64}
|
||||
if assigned(symbol) then
|
||||
begin
|
||||
writer.AsmWrite(symbol.name);
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(symbol.name));
|
||||
if SmartAsm then
|
||||
AddSymbol(symbol.name,false);
|
||||
first:=false;
|
||||
@ -440,7 +440,7 @@ interface
|
||||
begin
|
||||
if SmartAsm then
|
||||
AddSymbol(o.ref^.symbol.name,false);
|
||||
writer.AsmWrite(o.ref^.symbol.name);
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(o.ref^.symbol.name));
|
||||
if o.ref^.offset=0 then
|
||||
exit;
|
||||
end;
|
||||
@ -475,7 +475,7 @@ interface
|
||||
writer.AsmWrite('near ') just disables short branches, increasing code size.
|
||||
Omitting it does not cause any bad effects, tested with nasm 2.11. }
|
||||
|
||||
writer.AsmWrite(o.ref^.symbol.name);
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(o.ref^.symbol.name));
|
||||
if SmartAsm then
|
||||
AddSymbol(o.ref^.symbol.name,false);
|
||||
if o.ref^.offset>0 then
|
||||
@ -803,7 +803,7 @@ interface
|
||||
if tai_datablock(hp).sym.bind=AB_PRIVATE_EXTERN then
|
||||
WriteHiddenSymbolAttribute(tai_datablock(hp).sym);
|
||||
end;
|
||||
writer.AsmWrite(PadTabs(tai_datablock(hp).sym.name,':'));
|
||||
writer.AsmWrite(PadTabs(ApplyAsmSymbolRestrictions(tai_datablock(hp).sym.name),':'));
|
||||
if SmartAsm then
|
||||
AddSymbol(tai_datablock(hp).sym.name,true);
|
||||
writer.AsmWriteLn('RESB'#9+tostr(tai_datablock(hp).size));
|
||||
@ -828,13 +828,13 @@ interface
|
||||
begin
|
||||
if SmartAsm then
|
||||
AddSymbol(tai_const(hp).sym.name,false);
|
||||
writer.AsmWrite(tai_const(hp).sym.name);
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_const(hp).sym.name));
|
||||
if tai_const(hp).value<>0 then
|
||||
writer.AsmWrite(tostr_with_plus(tai_const(hp).value));
|
||||
writer.AsmLn;
|
||||
writer.AsmWrite(ait_const2str[aitconst_16bit]);
|
||||
writer.AsmWrite('SEG ');
|
||||
writer.AsmWrite(tai_const(hp).sym.name);
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_const(hp).sym.name));
|
||||
end
|
||||
else
|
||||
writer.AsmWrite(tostr(lo(longint(tai_const(hp).value)))+','+
|
||||
@ -849,7 +849,7 @@ interface
|
||||
if SmartAsm then
|
||||
AddSymbol(tai_const(hp).sym.name,false);
|
||||
writer.AsmWrite('SEG ');
|
||||
writer.AsmWrite(tai_const(hp).sym.name);
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_const(hp).sym.name));
|
||||
end
|
||||
else
|
||||
internalerror(2015110501);
|
||||
@ -888,9 +888,9 @@ interface
|
||||
AddSymbol(tai_const(hp).endsym.name,false);
|
||||
end;
|
||||
if assigned(tai_const(hp).endsym) then
|
||||
s:=tai_const(hp).endsym.name+'-'+tai_const(hp).sym.name
|
||||
s:=ApplyAsmSymbolRestrictions(tai_const(hp).endsym.name)+'-'+ApplyAsmSymbolRestrictions(tai_const(hp).sym.name)
|
||||
else
|
||||
s:=tai_const(hp).sym.name;
|
||||
s:=ApplyAsmSymbolRestrictions(tai_const(hp).sym.name);
|
||||
if tai_const(hp).value<>0 then
|
||||
s:=s+tostr_with_plus(tai_const(hp).value);
|
||||
end
|
||||
@ -1002,9 +1002,9 @@ interface
|
||||
if SmartAsm and (tai_label(hp).labsym.bind=AB_GLOBAL) then
|
||||
begin
|
||||
writer.AsmWrite(#9'GLOBAL ');
|
||||
writer.AsmWriteLn(tai_label(hp).labsym.name);
|
||||
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_label(hp).labsym.name));
|
||||
end;
|
||||
writer.AsmWriteLn(tai_label(hp).labsym.name+':');
|
||||
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_label(hp).labsym.name)+':');
|
||||
end;
|
||||
if SmartAsm then
|
||||
AddSymbol(tai_label(hp).labsym.name,true);
|
||||
@ -1017,11 +1017,11 @@ interface
|
||||
if tai_symbol(hp).is_global or SmartAsm then
|
||||
begin
|
||||
writer.AsmWrite(#9'GLOBAL ');
|
||||
writer.AsmWriteLn(tai_symbol(hp).sym.name);
|
||||
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name));
|
||||
if tai_symbol(hp).sym.bind=AB_PRIVATE_EXTERN then
|
||||
WriteHiddenSymbolAttribute(tai_symbol(hp).sym);
|
||||
end;
|
||||
writer.AsmWrite(tai_symbol(hp).sym.name);
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name));
|
||||
if SmartAsm then
|
||||
AddSymbol(tai_symbol(hp).sym.name,true);
|
||||
if (not assigned(hp.next)) or (assigned(hp.next) and not(tai(hp.next).typ in
|
||||
@ -1341,7 +1341,7 @@ interface
|
||||
begin
|
||||
sym:=TAsmSymbol(current_asmdata.AsmSymbolDict[i]);
|
||||
if sym.bind in [AB_EXTERNAL,AB_EXTERNAL_INDIRECT] then
|
||||
writer.AsmWriteln('EXTERN'#9+sym.name);
|
||||
writer.AsmWriteln('EXTERN'#9+ApplyAsmSymbolRestrictions(sym.name));
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1353,7 +1353,7 @@ interface
|
||||
while assigned(EC) do
|
||||
begin
|
||||
if not EC^.is_defined then
|
||||
writer.AsmWriteln('EXTERN'#9+EC^.psym^);
|
||||
writer.AsmWriteln('EXTERN'#9+ApplyAsmSymbolRestrictions(EC^.psym^));
|
||||
EC:=EC^.next;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user