mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 14:48:18 +02:00
* ReplaceForbiddenAsmSymbolChars renamed ApplyAsmSymbolRestrictions, because now it also applies the
label length limit git-svn-id: branches/z80@45085 -
This commit is contained in:
parent
4165e3224a
commit
3d81dd0b00
@ -240,7 +240,7 @@ interface
|
||||
function create_smartlink_library:boolean;inline;
|
||||
function create_smartlink:boolean;inline;
|
||||
|
||||
function ReplaceForbiddenAsmSymbolChars(const s: ansistring): ansistring;
|
||||
function ApplyAsmSymbolRestrictions(const s: ansistring): ansistring;
|
||||
|
||||
{ dummy default noop callback }
|
||||
procedure default_global_used;
|
||||
@ -288,7 +288,7 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
function ReplaceForbiddenAsmSymbolChars(const s: ansistring): ansistring;
|
||||
function ApplyAsmSymbolRestrictions(const s: ansistring): ansistring;
|
||||
var
|
||||
i : longint;
|
||||
rchar: char;
|
||||
|
@ -873,7 +873,7 @@ implementation
|
||||
begin
|
||||
if tai_section(hp).sectype<>sec_none then
|
||||
if replaceforbidden then
|
||||
WriteSection(tai_section(hp).sectype,ReplaceForbiddenAsmSymbolChars(tai_section(hp).name^),tai_section(hp).secorder,
|
||||
WriteSection(tai_section(hp).sectype,ApplyAsmSymbolRestrictions(tai_section(hp).name^),tai_section(hp).secorder,
|
||||
tai_section(hp).secalign,tai_section(hp).secflags,tai_section(hp).secprogbits)
|
||||
else
|
||||
WriteSection(tai_section(hp).sectype,tai_section(hp).name^,tai_section(hp).secorder,
|
||||
@ -925,8 +925,8 @@ implementation
|
||||
if tai_datablock(hp).is_global then
|
||||
begin
|
||||
writer.AsmWrite(#9'.globl ');
|
||||
writer.AsmWriteln(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name));
|
||||
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name));
|
||||
writer.AsmWriteln(ApplyAsmSymbolRestrictions(tai_datablock(hp).sym.name));
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_datablock(hp).sym.name));
|
||||
writer.AsmWriteln(':');
|
||||
writer.AsmWrite(#9'.space ');
|
||||
writer.AsmWriteln(tostr(tai_datablock(hp).size));
|
||||
@ -936,7 +936,7 @@ implementation
|
||||
else
|
||||
begin
|
||||
writer.AsmWrite(#9'.lcomm ');
|
||||
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name));
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_datablock(hp).sym.name));
|
||||
writer.AsmWrite(',');
|
||||
writer.AsmWrite(tostr(tai_datablock(hp).size)+',');
|
||||
writer.AsmWrite('_data.bss_,');
|
||||
@ -956,7 +956,7 @@ implementation
|
||||
begin
|
||||
writer.AsmWrite(#9'.comm'#9);
|
||||
if replaceforbidden then
|
||||
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name))
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_datablock(hp).sym.name))
|
||||
else
|
||||
writer.AsmWrite(tai_datablock(hp).sym.name);
|
||||
writer.AsmWrite(','+tostr(tai_datablock(hp).size));
|
||||
@ -967,7 +967,7 @@ implementation
|
||||
begin
|
||||
writer.AsmWrite(#9'.lcomm'#9);
|
||||
if replaceforbidden then
|
||||
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name));
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_datablock(hp).sym.name));
|
||||
else
|
||||
writer.AsmWrite(tai_datablock(hp).sym.name);
|
||||
writer.AsmWrite(','+tostr(tai_datablock(hp).size));
|
||||
@ -984,7 +984,7 @@ implementation
|
||||
WriteHiddenSymbol(tai_datablock(hp).sym);
|
||||
writer.AsmWrite(#9'.globl ');
|
||||
if replaceforbidden then
|
||||
writer.AsmWriteln(ReplaceForbiddenAsmSymbolChars(Tai_datablock(hp).sym.name))
|
||||
writer.AsmWriteln(ApplyAsmSymbolRestrictions(Tai_datablock(hp).sym.name))
|
||||
else
|
||||
writer.AsmWriteln(Tai_datablock(hp).sym.name);
|
||||
end;
|
||||
@ -995,10 +995,10 @@ implementation
|
||||
if replaceforbidden then
|
||||
begin
|
||||
if (tf_needs_symbol_type in target_info.flags) then
|
||||
writer.AsmWriteln(#9'.type '+ReplaceForbiddenAsmSymbolChars(Tai_datablock(hp).sym.name)+','+sepChar+'object');
|
||||
writer.AsmWriteln(#9'.type '+ApplyAsmSymbolRestrictions(Tai_datablock(hp).sym.name)+','+sepChar+'object');
|
||||
if (tf_needs_symbol_size in target_info.flags) and (tai_datablock(hp).size > 0) then
|
||||
writer.AsmWriteln(#9'.size '+ReplaceForbiddenAsmSymbolChars(Tai_datablock(hp).sym.name)+','+tostr(Tai_datablock(hp).size));
|
||||
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(Tai_datablock(hp).sym.name))
|
||||
writer.AsmWriteln(#9'.size '+ApplyAsmSymbolRestrictions(Tai_datablock(hp).sym.name)+','+tostr(Tai_datablock(hp).size));
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(Tai_datablock(hp).sym.name))
|
||||
end
|
||||
else
|
||||
begin
|
||||
@ -1198,7 +1198,7 @@ implementation
|
||||
else
|
||||
s:=tai_const(hp).sym.name;
|
||||
if replaceforbidden then
|
||||
s:=ReplaceForbiddenAsmSymbolChars(s);
|
||||
s:=ApplyAsmSymbolRestrictions(s);
|
||||
if tai_const(hp).value<>0 then
|
||||
s:=s+tostr_with_plus(tai_const(hp).value);
|
||||
end
|
||||
@ -1300,12 +1300,12 @@ implementation
|
||||
{$endif arm}
|
||||
writer.AsmWrite('.globl'#9);
|
||||
if replaceforbidden then
|
||||
writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_label(hp).labsym.name))
|
||||
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_label(hp).labsym.name))
|
||||
else
|
||||
writer.AsmWriteLn(tai_label(hp).labsym.name);
|
||||
end;
|
||||
if replaceforbidden then
|
||||
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_label(hp).labsym.name))
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_label(hp).labsym.name))
|
||||
else
|
||||
writer.AsmWrite(tai_label(hp).labsym.name);
|
||||
writer.AsmWriteLn(':');
|
||||
@ -1323,7 +1323,7 @@ implementation
|
||||
begin
|
||||
writer.AsmWrite('.globl'#9);
|
||||
if replaceforbidden then
|
||||
writer.AsmWriteln(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name))
|
||||
writer.AsmWriteln(ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name))
|
||||
else
|
||||
writer.AsmWriteln(tai_symbol(hp).sym.name);
|
||||
if (tai_symbol(hp).sym.bind=AB_PRIVATE_EXTERN) then
|
||||
@ -1358,14 +1358,14 @@ implementation
|
||||
s:=#9'.llong .';
|
||||
ch:='3';
|
||||
end;
|
||||
writer.AsmWriteLn(#9'.csect '+ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name)+'[DS],'+ch);
|
||||
writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name)+':');
|
||||
writer.AsmWriteln(s+ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name)+', TOC[tc0], 0');
|
||||
writer.AsmWriteLn(#9'.csect '+ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name)+'[DS],'+ch);
|
||||
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name)+':');
|
||||
writer.AsmWriteln(s+ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name)+', TOC[tc0], 0');
|
||||
writer.AsmWriteln(#9'.csect .text[PR]');
|
||||
if (tai_symbol(hp).is_global) then
|
||||
writer.AsmWriteLn('.globl .'+ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name))
|
||||
writer.AsmWriteLn('.globl .'+ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name))
|
||||
else
|
||||
writer.AsmWriteLn('.lglobl .'+ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name));
|
||||
writer.AsmWriteLn('.lglobl .'+ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name));
|
||||
{ the dotted name is the name of the actual function entry }
|
||||
writer.AsmWrite('.');
|
||||
end
|
||||
@ -1386,9 +1386,9 @@ implementation
|
||||
end;
|
||||
if replaceforbidden then
|
||||
if not(tai_symbol(hp).has_value) then
|
||||
writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name + ':'))
|
||||
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name + ':'))
|
||||
else
|
||||
writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name + '=' + tostr(tai_symbol(hp).value)))
|
||||
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name + '=' + tostr(tai_symbol(hp).value)))
|
||||
else if not(tai_symbol(hp).has_value) then
|
||||
writer.AsmWriteLn(tai_symbol(hp).sym.name + ':')
|
||||
else
|
||||
@ -1408,13 +1408,13 @@ implementation
|
||||
if replaceforbidden then
|
||||
begin
|
||||
{ avoid string truncation }
|
||||
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_symbolpair(hp).sym^));
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_symbolpair(hp).sym^));
|
||||
writer.AsmWrite(s);
|
||||
writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbolpair(hp).value^));
|
||||
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_symbolpair(hp).value^));
|
||||
if tai_symbolpair(hp).kind=spk_set_global then
|
||||
begin
|
||||
writer.AsmWrite(#9'.globl ');
|
||||
writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbolpair(hp).sym^));
|
||||
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_symbolpair(hp).sym^));
|
||||
end;
|
||||
end
|
||||
else
|
||||
@ -1443,7 +1443,7 @@ implementation
|
||||
(tai_symbol_end(hp).sym.typ=AT_FUNCTION) then
|
||||
writer.AsmWrite('.');
|
||||
if replaceforbidden then
|
||||
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_symbol_end(hp).sym.name))
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_symbol_end(hp).sym.name))
|
||||
else
|
||||
writer.AsmWrite(tai_symbol_end(hp).sym.name);
|
||||
writer.AsmWrite(', '+s+' - ');
|
||||
@ -1452,7 +1452,7 @@ implementation
|
||||
(tai_symbol_end(hp).sym.typ=AT_FUNCTION) then
|
||||
writer.AsmWrite('.');
|
||||
if replaceforbidden then
|
||||
writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol_end(hp).sym.name))
|
||||
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_symbol_end(hp).sym.name))
|
||||
else
|
||||
writer.AsmWriteLn(tai_symbol_end(hp).sym.name);
|
||||
end;
|
||||
@ -1527,7 +1527,7 @@ implementation
|
||||
if tai_directive(hp).name <>'' then
|
||||
begin
|
||||
if replaceforbidden then
|
||||
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_directive(hp).name))
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_directive(hp).name))
|
||||
else
|
||||
writer.AsmWrite(tai_directive(hp).name);
|
||||
end;
|
||||
@ -1617,7 +1617,7 @@ implementation
|
||||
if asminfo^.dollarsign='$' then
|
||||
writer.AsmWriteLn(s.name)
|
||||
else
|
||||
writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(s.name))
|
||||
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(s.name))
|
||||
end;
|
||||
|
||||
|
||||
@ -1635,7 +1635,7 @@ implementation
|
||||
if asminfo^.dollarsign='$' then
|
||||
writer.AsmWriteLn(sym.name)
|
||||
else
|
||||
writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(sym.name))
|
||||
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(sym.name))
|
||||
end;
|
||||
|
||||
|
||||
|
@ -122,7 +122,7 @@ unit agavrgas;
|
||||
else if assigned(symbol) or (offset<>0) then
|
||||
begin
|
||||
if assigned(symbol) then
|
||||
s:=ReplaceForbiddenAsmSymbolChars(symbol.name);
|
||||
s:=ApplyAsmSymbolRestrictions(symbol.name);
|
||||
|
||||
if s='' then
|
||||
s:=tostr(offset)
|
||||
@ -165,7 +165,7 @@ unit agavrgas;
|
||||
top_ref:
|
||||
if o.ref^.refaddr=addr_full then
|
||||
begin
|
||||
hs:=ReplaceForbiddenAsmSymbolChars(o.ref^.symbol.name);
|
||||
hs:=ApplyAsmSymbolRestrictions(o.ref^.symbol.name);
|
||||
if o.ref^.offset>0 then
|
||||
hs:=hs+'+'+tostr(o.ref^.offset)
|
||||
else if o.ref^.offset<0 then
|
||||
|
@ -197,7 +197,7 @@ implementation
|
||||
if (Sym.typ=typesym) and (ttypesym(Sym).Fprettyname<>'') then
|
||||
result:=ttypesym(Sym).FPrettyName;
|
||||
if target_asm.dollarsign<>'$' then
|
||||
result:=ReplaceForbiddenAsmSymbolChars(result);
|
||||
result:=ApplyAsmSymbolRestrictions(result);
|
||||
end;
|
||||
|
||||
function GetSymTableName(SymTable : TSymTable) : string;
|
||||
@ -207,7 +207,7 @@ implementation
|
||||
else
|
||||
result := SymTable.RealName^;
|
||||
if target_asm.dollarsign<>'$' then
|
||||
result:=ReplaceForbiddenAsmSymbolChars(result);
|
||||
result:=ApplyAsmSymbolRestrictions(result);
|
||||
end;
|
||||
|
||||
const
|
||||
@ -1190,7 +1190,7 @@ implementation
|
||||
if s='name' then
|
||||
result:=GetSymName(sym)
|
||||
else if s='mangledname' then
|
||||
result:=ReplaceForbiddenAsmSymbolChars(sym.mangledname)
|
||||
result:=ApplyAsmSymbolRestrictions(sym.mangledname)
|
||||
else if s='ownername' then
|
||||
result:=GetSymTableName(sym.owner)
|
||||
else if s='line' then
|
||||
@ -1217,7 +1217,7 @@ implementation
|
||||
|
||||
function TDebugInfoStabs.staticvarsym_mangled_name(sym: tstaticvarsym): string;
|
||||
begin
|
||||
result:=ReplaceForbiddenAsmSymbolChars(sym.mangledname);
|
||||
result:=ApplyAsmSymbolRestrictions(sym.mangledname);
|
||||
end;
|
||||
|
||||
|
||||
@ -1228,7 +1228,7 @@ implementation
|
||||
assigned(def.owner.name) then
|
||||
list.concat(Tai_stab.create_ansistr(stabsdir,ansistring('"vmt_')+GetSymTableName(def.owner)+tobjectdef(def).objname^+':S'+
|
||||
def_stab_number(vmttype)+'",'+
|
||||
base_stabs_str(globalvarsym_inited_stab,'0','0',ReplaceForbiddenAsmSymbolChars(tobjectdef(def).vmt_mangledname))));
|
||||
base_stabs_str(globalvarsym_inited_stab,'0','0',ApplyAsmSymbolRestrictions(tobjectdef(def).vmt_mangledname))));
|
||||
end;
|
||||
|
||||
|
||||
@ -1401,7 +1401,7 @@ implementation
|
||||
assigned(tprocdef(def.owner.defowner).procsym) then
|
||||
info := ','+GetSymName(def.procsym)+','+GetSymName(tprocdef(def.owner.defowner).procsym);
|
||||
end;
|
||||
mangledname:=ReplaceForbiddenAsmSymbolChars(def.mangledname);
|
||||
mangledname:=ApplyAsmSymbolRestrictions(def.mangledname);
|
||||
if target_info.system in systems_dotted_function_names then
|
||||
mangledname:='.'+mangledname;
|
||||
result.concat(Tai_stab.Create_ansistr(stabsdir,'"'+obj+':'+RType+def_stab_number(def.returndef)+info+'",'+
|
||||
|
@ -95,7 +95,7 @@ implementation
|
||||
begin
|
||||
{ create reference to the local symbol at the same address as the global
|
||||
symbol (with same name as unmangled symbol, so GDB can find it) }
|
||||
Result:=ReplaceForbiddenAsmSymbolChars(sym.name);
|
||||
Result:=ApplyAsmSymbolRestrictions(sym.name);
|
||||
end;
|
||||
|
||||
|
||||
@ -109,7 +109,7 @@ implementation
|
||||
assigned(def.owner.name) then
|
||||
list.concat(Tai_stab.create_ansistr(stabsdir,ansistring('"vmt_')+GetSymTableName(def.owner)+tobjectdef(def).objname^+':S'+
|
||||
def_stab_number(vmttype)+'",'+
|
||||
base_stabs_str(globalvarsym_inited_stab,'0','0',ReplaceForbiddenAsmSymbolChars(tobjectdef(def).vmt_mangledname)+'.')));
|
||||
base_stabs_str(globalvarsym_inited_stab,'0','0',ApplyAsmSymbolRestrictions(tobjectdef(def).vmt_mangledname)+'.')));
|
||||
end;
|
||||
*)
|
||||
{ do nothing, because creating debug information for a global symbol
|
||||
@ -193,7 +193,7 @@ implementation
|
||||
the place where it is defined }
|
||||
if not assigned(def.procstarttai) then
|
||||
exit;
|
||||
mangledname:=ReplaceForbiddenAsmSymbolChars(def.mangledname);
|
||||
mangledname:=ApplyAsmSymbolRestrictions(def.mangledname);
|
||||
if target_info.system in systems_dotted_function_names then
|
||||
mangledname:='.'+mangledname;
|
||||
result.concat(tai_stab.create(stabx_function,
|
||||
@ -254,7 +254,7 @@ implementation
|
||||
result:=inherited gen_procdef_endsym_stabs(def);
|
||||
if not assigned(def.procstarttai) then
|
||||
exit;
|
||||
procendsymbol:=current_asmdata.DefineAsmSymbol('LT..'+ReplaceForbiddenAsmSymbolChars(def.mangledname),AB_LOCAL,AT_ADDR,voidpointertype);
|
||||
procendsymbol:=current_asmdata.DefineAsmSymbol('LT..'+ApplyAsmSymbolRestrictions(def.mangledname),AB_LOCAL,AT_ADDR,voidpointertype);
|
||||
current_asmdata.asmlists[al_procedures].insertbefore(tai_symbol.create(procendsymbol,0),def.procendtai);
|
||||
end;
|
||||
|
||||
|
@ -1271,7 +1271,7 @@ implementation
|
||||
writer.AsmWriteln(asminfo^.comment+'global/privateextern label: '+tai_label(hp).labsym.name);
|
||||
end;
|
||||
if replaceforbidden then
|
||||
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_label(hp).labsym.name))
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_label(hp).labsym.name))
|
||||
else
|
||||
writer.AsmWrite(tai_label(hp).labsym.name);
|
||||
writer.AsmWriteLn(':');
|
||||
|
@ -112,7 +112,7 @@ unit agppcgas;
|
||||
not assigned(symbol) then
|
||||
internalerror(2011122701);
|
||||
if asminfo^.dollarsign<>'$' then
|
||||
getreferencestring:=ReplaceForbiddenAsmSymbolChars(symbol.name)+'('+gas_regname(NR_RTOC)+')'
|
||||
getreferencestring:=ApplyAsmSymbolRestrictions(symbol.name)+'('+gas_regname(NR_RTOC)+')'
|
||||
else
|
||||
getreferencestring:=symbol.name+'('+gas_regname(NR_RTOC)+')';
|
||||
exit;
|
||||
@ -128,9 +128,9 @@ unit agppcgas;
|
||||
begin
|
||||
if asminfo^.dollarsign<>'$' then
|
||||
begin
|
||||
s:=s+ReplaceForbiddenAsmSymbolChars(symbol.name);
|
||||
s:=s+ApplyAsmSymbolRestrictions(symbol.name);
|
||||
if assigned(relsymbol) then
|
||||
s:=s+'-'+ReplaceForbiddenAsmSymbolChars(relsymbol.name)
|
||||
s:=s+'-'+ApplyAsmSymbolRestrictions(relsymbol.name)
|
||||
end
|
||||
else
|
||||
begin
|
||||
@ -206,7 +206,7 @@ unit agppcgas;
|
||||
internalerror(200402267);
|
||||
hs:=o.ref^.symbol.name;
|
||||
if asminfo^.dollarsign<>'$' then
|
||||
hs:=ReplaceForbiddenAsmSymbolChars(hs);
|
||||
hs:=ApplyAsmSymbolRestrictions(hs);
|
||||
if o.ref^.offset>0 then
|
||||
hs:=hs+'+'+tostr(o.ref^.offset)
|
||||
else
|
||||
@ -236,7 +236,7 @@ unit agppcgas;
|
||||
begin
|
||||
hs:=o.ref^.symbol.name;
|
||||
if asminfo^.dollarsign<>'$' then
|
||||
hs:=ReplaceForbiddenAsmSymbolChars(hs);
|
||||
hs:=ApplyAsmSymbolRestrictions(hs);
|
||||
if o.ref^.offset>0 then
|
||||
hs:=hs+'+'+tostr(o.ref^.offset)
|
||||
else
|
||||
|
@ -846,7 +846,7 @@ unit cgppc;
|
||||
current_asmdata.WeakRefAsmSymbol(symname,AT_DATA)
|
||||
else
|
||||
current_asmdata.WeakRefAsmSymbol('.'+symname,AT_DATA);
|
||||
newsymname:=ReplaceForbiddenAsmSymbolChars(symname);
|
||||
newsymname:=ApplyAsmSymbolRestrictions(symname);
|
||||
current_asmdata.asmlists[al_picdata].concat(tai_directive.Create(asd_toc_entry,newsymname+'[TC],'+newsymname));
|
||||
end;
|
||||
end
|
||||
@ -879,7 +879,7 @@ unit cgppc;
|
||||
ref.symbol:=tocsym;
|
||||
tocsym.ftocsecnr:=tocnr;
|
||||
current_asmdata.asmlists[al_indirectpicdata].concat(tai_symbol.create(tocsym,0));
|
||||
newsymname:=ReplaceForbiddenAsmSymbolChars(symname);
|
||||
newsymname:=ApplyAsmSymbolRestrictions(symname);
|
||||
sym:=current_asmdata.RefAsmSymbol(newsymname,AT_DATA);
|
||||
current_asmdata.asmlists[al_indirectpicdata].concat(tai_const.Create_sym(sym));
|
||||
end;
|
||||
|
@ -79,9 +79,9 @@ unit agrvgas;
|
||||
begin
|
||||
if asminfo^.dollarsign<>'$' then
|
||||
begin
|
||||
s:=s+ReplaceForbiddenAsmSymbolChars(symbol.name);
|
||||
s:=s+ApplyAsmSymbolRestrictions(symbol.name);
|
||||
if assigned(relsymbol) then
|
||||
s:=s+'-'+ReplaceForbiddenAsmSymbolChars(relsymbol.name)
|
||||
s:=s+'-'+ApplyAsmSymbolRestrictions(relsymbol.name)
|
||||
end
|
||||
else
|
||||
begin
|
||||
@ -159,7 +159,7 @@ unit agrvgas;
|
||||
begin
|
||||
hs:=o.ref^.symbol.name;
|
||||
if asminfo^.dollarsign<>'$' then
|
||||
hs:=ReplaceForbiddenAsmSymbolChars(hs);
|
||||
hs:=ApplyAsmSymbolRestrictions(hs);
|
||||
if o.ref^.offset>0 then
|
||||
hs:=hs+'+'+tostr(o.ref^.offset)
|
||||
else
|
||||
|
@ -394,9 +394,9 @@ unit agsdasz80;
|
||||
;
|
||||
end;
|
||||
if o.ref^.offset<>0 then
|
||||
writer.AsmWrite('('+ReplaceForbiddenAsmSymbolChars(o.ref^.symbol.name)+'+'+tostr(o.ref^.offset)+')')
|
||||
writer.AsmWrite('('+ApplyAsmSymbolRestrictions(o.ref^.symbol.name)+'+'+tostr(o.ref^.offset)+')')
|
||||
else
|
||||
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(o.ref^.symbol.name));
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(o.ref^.symbol.name));
|
||||
end
|
||||
else if not assigned(o.ref^.symbol) and
|
||||
((o.ref^.base<>NR_NO) or (o.ref^.index<>NR_NO)) and
|
||||
@ -442,7 +442,7 @@ unit agsdasz80;
|
||||
AddSymbol(o.ref^.symbol.name,false);}
|
||||
if need_plus then
|
||||
writer.AsmWrite('+');
|
||||
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(o.ref^.symbol.name));
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(o.ref^.symbol.name));
|
||||
need_plus:=true;
|
||||
end;
|
||||
if o.ref^.offset<>0 then
|
||||
@ -480,7 +480,7 @@ unit agsdasz80;
|
||||
end
|
||||
else
|
||||
begin
|
||||
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(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
|
||||
@ -505,7 +505,7 @@ unit agsdasz80;
|
||||
begin
|
||||
sym:=TAsmSymbol(current_asmdata.AsmSymbolDict[i]);
|
||||
if sym.bind in [AB_EXTERNAL,AB_EXTERNAL_INDIRECT] then
|
||||
writer.AsmWriteln(#9'.globl'#9+ReplaceForbiddenAsmSymbolChars(sym.name));
|
||||
writer.AsmWriteln(#9'.globl'#9+ApplyAsmSymbolRestrictions(sym.name));
|
||||
end;
|
||||
writer.AsmWriteln('; End externals');
|
||||
end;
|
||||
@ -607,7 +607,7 @@ unit agsdasz80;
|
||||
begin
|
||||
if tai_label(hp).labsym.is_used then
|
||||
begin
|
||||
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_label(hp).labsym.name));
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_label(hp).labsym.name));
|
||||
if tai_label(hp).labsym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN] then
|
||||
writer.AsmWriteLn('::')
|
||||
else
|
||||
@ -619,16 +619,16 @@ unit agsdasz80;
|
||||
if not(tai_symbol(hp).has_value) then
|
||||
begin
|
||||
if tai_symbol(hp).is_global then
|
||||
writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name) + '::')
|
||||
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name) + '::')
|
||||
else
|
||||
writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name) + ':');
|
||||
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name) + ':');
|
||||
end
|
||||
else
|
||||
begin
|
||||
if tai_symbol(hp).is_global then
|
||||
writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name) + '==' + tostr(tai_symbol(hp).value))
|
||||
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name) + '==' + tostr(tai_symbol(hp).value))
|
||||
else
|
||||
writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name) + '=' + tostr(tai_symbol(hp).value));
|
||||
writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_symbol(hp).sym.name) + '=' + tostr(tai_symbol(hp).value));
|
||||
end;
|
||||
end;
|
||||
ait_symbol_end :
|
||||
@ -637,9 +637,9 @@ unit agsdasz80;
|
||||
ait_datablock :
|
||||
begin
|
||||
if tai_datablock(hp).is_global or SmartAsm then
|
||||
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name) + '::')
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_datablock(hp).sym.name) + '::')
|
||||
else
|
||||
writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name) + ':');
|
||||
writer.AsmWrite(ApplyAsmSymbolRestrictions(tai_datablock(hp).sym.name) + ':');
|
||||
{if SmartAsm then
|
||||
AddSymbol(tai_datablock(hp).sym.name,true);}
|
||||
writer.AsmWriteLn(#9'.rs'#9+tostr(tai_datablock(hp).size));
|
||||
@ -666,9 +666,9 @@ unit agsdasz80;
|
||||
if assigned(tai_const(hp).sym) then
|
||||
begin
|
||||
if assigned(tai_const(hp).endsym) then
|
||||
s:=ReplaceForbiddenAsmSymbolChars(tai_const(hp).endsym.name)+'-'+ReplaceForbiddenAsmSymbolChars(tai_const(hp).sym.name)
|
||||
s:=ApplyAsmSymbolRestrictions(tai_const(hp).endsym.name)+'-'+ApplyAsmSymbolRestrictions(tai_const(hp).sym.name)
|
||||
else
|
||||
s:=ReplaceForbiddenAsmSymbolChars(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);
|
||||
if consttype in [aitconst_64bit,aitconst_64bit_unaligned] then
|
||||
@ -713,9 +713,9 @@ unit agsdasz80;
|
||||
if assigned(tai_const(hp).sym) then
|
||||
begin
|
||||
if assigned(tai_const(hp).endsym) then
|
||||
s:=ReplaceForbiddenAsmSymbolChars(tai_const(hp).endsym.name)+'-'+ReplaceForbiddenAsmSymbolChars(tai_const(hp).sym.name)
|
||||
s:=ApplyAsmSymbolRestrictions(tai_const(hp).endsym.name)+'-'+ApplyAsmSymbolRestrictions(tai_const(hp).sym.name)
|
||||
else
|
||||
s:=ReplaceForbiddenAsmSymbolChars(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
|
||||
|
@ -128,7 +128,7 @@ unit agz80asm;
|
||||
else if assigned(symbol) or (offset<>0) then
|
||||
begin
|
||||
//if assigned(symbol) then
|
||||
// s:=ReplaceForbiddenAsmSymbolChars(symbol.name);
|
||||
// s:=ApplyAsmSymbolRestrictions(symbol.name);
|
||||
//
|
||||
//if offset<0 then
|
||||
// s:=s+tostr(offset)
|
||||
@ -167,7 +167,7 @@ unit agz80asm;
|
||||
// top_ref:
|
||||
// if o.ref^.refaddr=addr_full then
|
||||
// begin
|
||||
// hs:=ReplaceForbiddenAsmSymbolChars(o.ref^.symbol.name);
|
||||
// hs:=ApplyAsmSymbolRestrictions(o.ref^.symbol.name);
|
||||
// if o.ref^.offset>0 then
|
||||
// hs:=hs+'+'+tostr(o.ref^.offset)
|
||||
// else
|
||||
|
Loading…
Reference in New Issue
Block a user