|
@@ -437,7 +437,7 @@ implementation
|
|
|
var
|
|
|
s : string;
|
|
|
begin
|
|
|
- AsmLn;
|
|
|
+ writer.AsmLn;
|
|
|
case target_info.system of
|
|
|
system_i386_OS2,
|
|
|
system_i386_EMX,
|
|
@@ -454,17 +454,17 @@ implementation
|
|
|
system_powerpc64_aix:
|
|
|
begin
|
|
|
if (atype in [sec_stub,sec_objc_data,sec_objc_const,sec_data_coalesced]) then
|
|
|
- AsmWrite('.section ');
|
|
|
+ writer.AsmWrite('.section ');
|
|
|
end
|
|
|
else
|
|
|
- AsmWrite('.section ');
|
|
|
+ writer.AsmWrite('.section ');
|
|
|
end;
|
|
|
s:=sectionname(atype,aname,aorder);
|
|
|
- AsmWrite(s);
|
|
|
+ writer.AsmWrite(s);
|
|
|
case atype of
|
|
|
sec_fpc :
|
|
|
if aname = 'resptrs' then
|
|
|
- AsmWrite(', "a", @progbits');
|
|
|
+ writer.AsmWrite(', "a", @progbits');
|
|
|
sec_stub :
|
|
|
begin
|
|
|
case target_info.system of
|
|
@@ -474,17 +474,17 @@ implementation
|
|
|
system_powerpc_darwin,
|
|
|
system_powerpc64_darwin:
|
|
|
if (cs_create_pic in current_settings.moduleswitches) then
|
|
|
- AsmWriteln('__TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32')
|
|
|
+ writer.AsmWriteln('__TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32')
|
|
|
else
|
|
|
- AsmWriteln('__TEXT,__symbol_stub1,symbol_stubs,pure_instructions,16');
|
|
|
+ writer.AsmWriteln('__TEXT,__symbol_stub1,symbol_stubs,pure_instructions,16');
|
|
|
system_i386_darwin,
|
|
|
system_i386_iphonesim:
|
|
|
- AsmWriteln('__IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5');
|
|
|
+ writer.AsmWriteln('__IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5');
|
|
|
system_arm_darwin:
|
|
|
if (cs_create_pic in current_settings.moduleswitches) then
|
|
|
- AsmWriteln('__TEXT,__picsymbolstub4,symbol_stubs,none,16')
|
|
|
+ writer.AsmWriteln('__TEXT,__picsymbolstub4,symbol_stubs,none,16')
|
|
|
else
|
|
|
- AsmWriteln('__TEXT,__symbol_stub4,symbol_stubs,none,12')
|
|
|
+ writer.AsmWriteln('__TEXT,__symbol_stub4,symbol_stubs,none,12')
|
|
|
{ darwin/(x86-64/AArch64) uses PC-based GOT addressing, no
|
|
|
explicit symbol stubs }
|
|
|
else
|
|
@@ -503,16 +503,16 @@ implementation
|
|
|
begin
|
|
|
s:=sectionattrs_coff(atype);
|
|
|
if (s<>'') then
|
|
|
- AsmWrite(',"'+s+'"');
|
|
|
+ writer.AsmWrite(',"'+s+'"');
|
|
|
end
|
|
|
else if target_info.system in systems_aix then
|
|
|
begin
|
|
|
s:=sectionalignment_aix(atype,secalign);
|
|
|
if s<>'' then
|
|
|
- AsmWrite(','+s);
|
|
|
+ writer.AsmWrite(','+s);
|
|
|
end;
|
|
|
end;
|
|
|
- AsmLn;
|
|
|
+ writer.AsmLn;
|
|
|
LastSecType:=atype;
|
|
|
end;
|
|
|
|
|
@@ -526,8 +526,8 @@ implementation
|
|
|
for i:=0 to len-1 do
|
|
|
begin
|
|
|
if (i > 0) then
|
|
|
- AsmWrite(',');
|
|
|
- AsmWrite(tostr(buf[i]));
|
|
|
+ writer.AsmWrite(',');
|
|
|
+ writer.AsmWrite(tostr(buf[i]));
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -541,8 +541,8 @@ implementation
|
|
|
for i:=0 to len-1 do
|
|
|
begin
|
|
|
if (i > 0) then
|
|
|
- AsmWrite(',');
|
|
|
- AsmWrite(tostr(buf[i]));
|
|
|
+ writer.AsmWrite(',');
|
|
|
+ writer.AsmWrite(tostr(buf[i]));
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -585,18 +585,18 @@ implementation
|
|
|
instr:='0x51fc'
|
|
|
else}
|
|
|
instr:='0x4e71';
|
|
|
- AsmWrite(#9'.balignw '+tostr(alignment)+','+instr);
|
|
|
+ writer.AsmWrite(#9'.balignw '+tostr(alignment)+','+instr);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
{$endif m68k}
|
|
|
- AsmWrite(#9'.balign '+tostr(alignment));
|
|
|
+ writer.AsmWrite(#9'.balign '+tostr(alignment));
|
|
|
if use_op then
|
|
|
- AsmWrite(','+tostr(fillop))
|
|
|
+ writer.AsmWrite(','+tostr(fillop))
|
|
|
{$ifdef x86}
|
|
|
{ force NOP as alignment op code }
|
|
|
else if LastSecType=sec_code then
|
|
|
- AsmWrite(',0x90');
|
|
|
+ writer.AsmWrite(',0x90');
|
|
|
{$endif x86}
|
|
|
{$ifdef m68k}
|
|
|
end;
|
|
@@ -607,10 +607,10 @@ implementation
|
|
|
{ darwin and aix as only support .align }
|
|
|
if not ispowerof2(alignment,i) then
|
|
|
internalerror(2003010305);
|
|
|
- AsmWrite(#9'.align '+tostr(i));
|
|
|
+ writer.AsmWrite(#9'.align '+tostr(i));
|
|
|
last_align:=i;
|
|
|
end;
|
|
|
- AsmLn;
|
|
|
+ writer.AsmLn;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -661,27 +661,27 @@ implementation
|
|
|
|
|
|
ait_comment :
|
|
|
Begin
|
|
|
- AsmWrite(target_asm.comment);
|
|
|
- AsmWritePChar(tai_comment(hp).str);
|
|
|
- AsmLn;
|
|
|
+ writer.AsmWrite(target_asm.comment);
|
|
|
+ writer.AsmWritePChar(tai_comment(hp).str);
|
|
|
+ writer.AsmLn;
|
|
|
End;
|
|
|
|
|
|
ait_regalloc :
|
|
|
begin
|
|
|
if (cs_asm_regalloc in current_settings.globalswitches) then
|
|
|
begin
|
|
|
- AsmWrite(#9+target_asm.comment+'Register ');
|
|
|
+ writer.AsmWrite(#9+target_asm.comment+'Register ');
|
|
|
repeat
|
|
|
- AsmWrite(std_regname(Tai_regalloc(hp).reg));
|
|
|
+ writer.AsmWrite(std_regname(Tai_regalloc(hp).reg));
|
|
|
if (hp.next=nil) or
|
|
|
(tai(hp.next).typ<>ait_regalloc) or
|
|
|
(tai_regalloc(hp.next).ratype<>tai_regalloc(hp).ratype) then
|
|
|
break;
|
|
|
hp:=tai(hp.next);
|
|
|
- AsmWrite(',');
|
|
|
+ writer.AsmWrite(',');
|
|
|
until false;
|
|
|
- AsmWrite(' ');
|
|
|
- AsmWriteLn(regallocstr[tai_regalloc(hp).ratype]);
|
|
|
+ writer.AsmWrite(' ');
|
|
|
+ writer.AsmWriteLn(regallocstr[tai_regalloc(hp).ratype]);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -706,8 +706,8 @@ implementation
|
|
|
else
|
|
|
begin
|
|
|
{$ifdef EXTDEBUG}
|
|
|
- AsmWrite(target_asm.comment);
|
|
|
- AsmWriteln(' sec_none');
|
|
|
+ writer.AsmWrite(target_asm.comment);
|
|
|
+ writer.AsmWriteln(' sec_none');
|
|
|
{$endif EXTDEBUG}
|
|
|
end;
|
|
|
end;
|
|
@@ -724,45 +724,45 @@ implementation
|
|
|
}
|
|
|
if tai_datablock(hp).is_global then
|
|
|
begin
|
|
|
- asmwrite('.globl ');
|
|
|
- asmwriteln(tai_datablock(hp).sym.name);
|
|
|
- asmwriteln('.data');
|
|
|
- asmwrite('.zerofill __DATA, __common, ');
|
|
|
- asmwrite(tai_datablock(hp).sym.name);
|
|
|
- asmwriteln(', '+tostr(tai_datablock(hp).size)+','+tostr(last_align));
|
|
|
+ writer.AsmWrite('.globl ');
|
|
|
+ writer.AsmWriteln(tai_datablock(hp).sym.name);
|
|
|
+ writer.AsmWriteln('.data');
|
|
|
+ writer.AsmWrite('.zerofill __DATA, __common, ');
|
|
|
+ writer.AsmWrite(tai_datablock(hp).sym.name);
|
|
|
+ writer.AsmWriteln(', '+tostr(tai_datablock(hp).size)+','+tostr(last_align));
|
|
|
if not(LastSecType in [sec_data,sec_none]) then
|
|
|
writesection(LastSecType,'',secorder_default,1 shl last_align);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
- asmwrite(#9'.lcomm'#9);
|
|
|
- asmwrite(tai_datablock(hp).sym.name);
|
|
|
- asmwrite(','+tostr(tai_datablock(hp).size));
|
|
|
- asmwrite(','+tostr(last_align));
|
|
|
- asmln;
|
|
|
+ writer.AsmWrite(#9'.lcomm'#9);
|
|
|
+ writer.AsmWrite(tai_datablock(hp).sym.name);
|
|
|
+ writer.AsmWrite(','+tostr(tai_datablock(hp).size));
|
|
|
+ writer.AsmWrite(','+tostr(last_align));
|
|
|
+ writer.AsmLn;
|
|
|
end;
|
|
|
end
|
|
|
else if target_info.system in systems_aix then
|
|
|
begin
|
|
|
if tai_datablock(hp).is_global then
|
|
|
begin
|
|
|
- asmwrite(#9'.globl ');
|
|
|
- asmwriteln(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name));
|
|
|
- asmwrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name));
|
|
|
- asmwriteln(':');
|
|
|
- asmwrite(#9'.space ');
|
|
|
- asmwriteln(tostr(tai_datablock(hp).size));
|
|
|
+ writer.AsmWrite(#9'.globl ');
|
|
|
+ writer.AsmWriteln(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name));
|
|
|
+ writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name));
|
|
|
+ writer.AsmWriteln(':');
|
|
|
+ writer.AsmWrite(#9'.space ');
|
|
|
+ writer.AsmWriteln(tostr(tai_datablock(hp).size));
|
|
|
if not(LastSecType in [sec_data,sec_none]) then
|
|
|
writesection(LastSecType,'',secorder_default,1 shl last_align);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
- asmwrite(#9'.lcomm ');
|
|
|
- asmwrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name));
|
|
|
- asmwrite(',');
|
|
|
- asmwrite(tostr(tai_datablock(hp).size)+',');
|
|
|
- asmwrite('_data.bss_,');
|
|
|
- asmwriteln(tostr(last_align));
|
|
|
+ writer.AsmWrite(#9'.lcomm ');
|
|
|
+ writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name));
|
|
|
+ writer.AsmWrite(',');
|
|
|
+ writer.AsmWrite(tostr(tai_datablock(hp).size)+',');
|
|
|
+ writer.AsmWrite('_data.bss_,');
|
|
|
+ writer.AsmWriteln(tostr(last_align));
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
@@ -776,25 +776,25 @@ implementation
|
|
|
program (PFV) }
|
|
|
if tai_datablock(hp).is_global then
|
|
|
begin
|
|
|
- asmwrite(#9'.comm'#9);
|
|
|
+ writer.AsmWrite(#9'.comm'#9);
|
|
|
if replaceforbidden then
|
|
|
- asmwrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name))
|
|
|
+ writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name))
|
|
|
else
|
|
|
- asmwrite(tai_datablock(hp).sym.name);
|
|
|
- asmwrite(','+tostr(tai_datablock(hp).size));
|
|
|
- asmwrite(','+tostr(last_align));
|
|
|
- asmln;
|
|
|
+ writer.AsmWrite(tai_datablock(hp).sym.name);
|
|
|
+ writer.AsmWrite(','+tostr(tai_datablock(hp).size));
|
|
|
+ writer.AsmWrite(','+tostr(last_align));
|
|
|
+ writer.AsmLn;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
- asmwrite(#9'.lcomm'#9);
|
|
|
+ writer.AsmWrite(#9'.lcomm'#9);
|
|
|
if replaceforbidden then
|
|
|
- asmwrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name));
|
|
|
+ writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_datablock(hp).sym.name));
|
|
|
else
|
|
|
- asmwrite(tai_datablock(hp).sym.name);
|
|
|
- asmwrite(','+tostr(tai_datablock(hp).size));
|
|
|
- asmwrite(','+tostr(last_align));
|
|
|
- asmln;
|
|
|
+ writer.AsmWrite(tai_datablock(hp).sym.name);
|
|
|
+ writer.AsmWrite(','+tostr(tai_datablock(hp).size));
|
|
|
+ writer.AsmWrite(','+tostr(last_align));
|
|
|
+ writer.AsmLn;
|
|
|
end
|
|
|
end
|
|
|
else
|
|
@@ -802,11 +802,11 @@ implementation
|
|
|
begin
|
|
|
if Tai_datablock(hp).is_global then
|
|
|
begin
|
|
|
- asmwrite(#9'.globl ');
|
|
|
+ writer.AsmWrite(#9'.globl ');
|
|
|
if replaceforbidden then
|
|
|
- asmwriteln(ReplaceForbiddenAsmSymbolChars(Tai_datablock(hp).sym.name))
|
|
|
+ writer.AsmWriteln(ReplaceForbiddenAsmSymbolChars(Tai_datablock(hp).sym.name))
|
|
|
else
|
|
|
- asmwriteln(Tai_datablock(hp).sym.name);
|
|
|
+ writer.AsmWriteln(Tai_datablock(hp).sym.name);
|
|
|
end;
|
|
|
if ((target_info.system <> system_arm_linux) and (target_info.system <> system_arm_android)) then
|
|
|
sepChar := '@'
|
|
@@ -815,21 +815,21 @@ implementation
|
|
|
if replaceforbidden then
|
|
|
begin
|
|
|
if (tf_needs_symbol_type in target_info.flags) then
|
|
|
- asmwriteln(#9'.type '+ReplaceForbiddenAsmSymbolChars(Tai_datablock(hp).sym.name)+','+sepChar+'object');
|
|
|
+ writer.AsmWriteln(#9'.type '+ReplaceForbiddenAsmSymbolChars(Tai_datablock(hp).sym.name)+','+sepChar+'object');
|
|
|
if (tf_needs_symbol_size in target_info.flags) and (tai_datablock(hp).size > 0) then
|
|
|
- asmwriteln(#9'.size '+ReplaceForbiddenAsmSymbolChars(Tai_datablock(hp).sym.name)+','+tostr(Tai_datablock(hp).size));
|
|
|
- asmwrite(ReplaceForbiddenAsmSymbolChars(Tai_datablock(hp).sym.name))
|
|
|
+ writer.AsmWriteln(#9'.size '+ReplaceForbiddenAsmSymbolChars(Tai_datablock(hp).sym.name)+','+tostr(Tai_datablock(hp).size));
|
|
|
+ writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(Tai_datablock(hp).sym.name))
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if (tf_needs_symbol_type in target_info.flags) then
|
|
|
- asmwriteln(#9'.type '+Tai_datablock(hp).sym.name+','+sepChar+'object');
|
|
|
+ writer.AsmWriteln(#9'.type '+Tai_datablock(hp).sym.name+','+sepChar+'object');
|
|
|
if (tf_needs_symbol_size in target_info.flags) and (tai_datablock(hp).size > 0) then
|
|
|
- asmwriteln(#9'.size '+Tai_datablock(hp).sym.name+','+tostr(Tai_datablock(hp).size));
|
|
|
- asmwrite(Tai_datablock(hp).sym.name);
|
|
|
+ writer.AsmWriteln(#9'.size '+Tai_datablock(hp).sym.name+','+tostr(Tai_datablock(hp).size));
|
|
|
+ writer.AsmWrite(Tai_datablock(hp).sym.name);
|
|
|
end;
|
|
|
- asmwriteln(':');
|
|
|
- asmwriteln(#9'.zero '+tostr(Tai_datablock(hp).size));
|
|
|
+ writer.AsmWriteln(':');
|
|
|
+ writer.AsmWriteln(#9'.zero '+tostr(Tai_datablock(hp).size));
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
@@ -850,29 +850,29 @@ implementation
|
|
|
internalerror(200404292);
|
|
|
if not(target_info.system in systems_aix) then
|
|
|
begin
|
|
|
- AsmWrite(ait_const2str[aitconst_32bit]);
|
|
|
+ writer.AsmWrite(ait_const2str[aitconst_32bit]);
|
|
|
if target_info.endian = endian_little then
|
|
|
begin
|
|
|
- AsmWrite(tostr(longint(lo(tai_const(hp).value))));
|
|
|
- AsmWrite(',');
|
|
|
- AsmWrite(tostr(longint(hi(tai_const(hp).value))));
|
|
|
+ writer.AsmWrite(tostr(longint(lo(tai_const(hp).value))));
|
|
|
+ writer.AsmWrite(',');
|
|
|
+ writer.AsmWrite(tostr(longint(hi(tai_const(hp).value))));
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
- AsmWrite(tostr(longint(hi(tai_const(hp).value))));
|
|
|
- AsmWrite(',');
|
|
|
- AsmWrite(tostr(longint(lo(tai_const(hp).value))));
|
|
|
+ writer.AsmWrite(tostr(longint(hi(tai_const(hp).value))));
|
|
|
+ writer.AsmWrite(',');
|
|
|
+ writer.AsmWrite(tostr(longint(lo(tai_const(hp).value))));
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
WriteAixIntConst(tai_const(hp));
|
|
|
- AsmLn;
|
|
|
+ writer.AsmLn;
|
|
|
end;
|
|
|
{$endif cpu64bitaddr}
|
|
|
aitconst_got:
|
|
|
begin
|
|
|
- AsmWrite(#9'.word'#9+tai_const(hp).sym.name+'(GOT)');
|
|
|
- Asmln;
|
|
|
+ writer.AsmWrite(#9'.word'#9+tai_const(hp).sym.name+'(GOT)');
|
|
|
+ writer.AsmLn;
|
|
|
end;
|
|
|
|
|
|
aitconst_gotoff_symbol:
|
|
@@ -883,21 +883,21 @@ implementation
|
|
|
|
|
|
cpu_mipseb,cpu_mipsel:
|
|
|
begin
|
|
|
- AsmWrite(#9'.gpword'#9);
|
|
|
- AsmWrite(tai_const(hp).sym.name);
|
|
|
+ writer.AsmWrite(#9'.gpword'#9);
|
|
|
+ writer.AsmWrite(tai_const(hp).sym.name);
|
|
|
end;
|
|
|
|
|
|
cpu_i386:
|
|
|
begin
|
|
|
- AsmWrite(ait_const2str[aitconst_32bit]);
|
|
|
- AsmWrite(tai_const(hp).sym.name);
|
|
|
+ writer.AsmWrite(ait_const2str[aitconst_32bit]);
|
|
|
+ writer.AsmWrite(tai_const(hp).sym.name);
|
|
|
end;
|
|
|
else
|
|
|
InternalError(2014022602);
|
|
|
end;
|
|
|
if (tai_const(hp).value<>0) then
|
|
|
- AsmWrite(tostr_with_plus(tai_const(hp).value));
|
|
|
- Asmln;
|
|
|
+ writer.AsmWrite(tostr_with_plus(tai_const(hp).value));
|
|
|
+ writer.AsmLn;
|
|
|
end;
|
|
|
|
|
|
aitconst_uleb128bit,
|
|
@@ -934,7 +934,7 @@ implementation
|
|
|
else if (target_info.system in systems_darwin) and
|
|
|
(constdef in [aitconst_uleb128bit,aitconst_sleb128bit]) then
|
|
|
begin
|
|
|
- AsmWrite(ait_const2str[aitconst_8bit]);
|
|
|
+ writer.AsmWrite(ait_const2str[aitconst_8bit]);
|
|
|
case tai_const(hp).consttype of
|
|
|
aitconst_uleb128bit:
|
|
|
WriteDecodedUleb128(qword(tai_const(hp).value));
|
|
@@ -946,17 +946,17 @@ implementation
|
|
|
begin
|
|
|
if (constdef in ait_unaligned_consts) and
|
|
|
(target_info.system in use_ua_sparc_systems) then
|
|
|
- AsmWrite(ait_ua_sparc_const2str[constdef])
|
|
|
+ writer.AsmWrite(ait_ua_sparc_const2str[constdef])
|
|
|
else if (constdef in ait_unaligned_consts) and
|
|
|
(target_info.system in use_ua_elf_systems) then
|
|
|
- AsmWrite(ait_ua_elf_const2str[constdef])
|
|
|
+ writer.AsmWrite(ait_ua_elf_const2str[constdef])
|
|
|
{ we can also have unaligned pointers in packed record
|
|
|
constants, which don't get translated into
|
|
|
unaligned tai -> always use vbyte }
|
|
|
else if target_info.system in systems_aix then
|
|
|
- AsmWrite(#9'.vbyte'#9+tostr(tai_const(hp).size)+',')
|
|
|
+ writer.AsmWrite(#9'.vbyte'#9+tostr(tai_const(hp).size)+',')
|
|
|
else
|
|
|
- AsmWrite(ait_const2str[constdef]);
|
|
|
+ writer.AsmWrite(ait_const2str[constdef]);
|
|
|
l:=0;
|
|
|
t := '';
|
|
|
repeat
|
|
@@ -991,7 +991,7 @@ implementation
|
|
|
if constdef = aitconst_gs then
|
|
|
s:='gs('+s+')';
|
|
|
|
|
|
- AsmWrite(s);
|
|
|
+ writer.AsmWrite(s);
|
|
|
inc(l,length(s));
|
|
|
{ Values with symbols are written on a single line to improve
|
|
|
reading of the .s file (PFV) }
|
|
@@ -1004,15 +1004,15 @@ implementation
|
|
|
assigned(tai_const(hp.next).sym) then
|
|
|
break;
|
|
|
hp:=tai(hp.next);
|
|
|
- AsmWrite(',');
|
|
|
+ writer.AsmWrite(',');
|
|
|
until false;
|
|
|
if (t <> '') then
|
|
|
begin
|
|
|
- AsmLn;
|
|
|
- AsmWrite(t);
|
|
|
+ writer.AsmLn;
|
|
|
+ writer.AsmWrite(t);
|
|
|
end;
|
|
|
end;
|
|
|
- AsmLn;
|
|
|
+ writer.AsmLn;
|
|
|
end;
|
|
|
else
|
|
|
internalerror(200704251);
|
|
@@ -1033,7 +1033,7 @@ implementation
|
|
|
begin
|
|
|
if pos=0 then
|
|
|
begin
|
|
|
- AsmWrite(#9'.ascii'#9'"');
|
|
|
+ writer.AsmWrite(#9'.ascii'#9'"');
|
|
|
pos:=20;
|
|
|
end;
|
|
|
ch:=tai_string(hp).str[i-1];
|
|
@@ -1046,11 +1046,11 @@ implementation
|
|
|
else
|
|
|
s:=ch;
|
|
|
end;
|
|
|
- AsmWrite(s);
|
|
|
+ writer.AsmWrite(s);
|
|
|
inc(pos,length(s));
|
|
|
if (pos>line_length) or (i=tai_string(hp).len) then
|
|
|
begin
|
|
|
- AsmWriteLn('"');
|
|
|
+ writer.AsmWriteLn('"');
|
|
|
pos:=0;
|
|
|
end;
|
|
|
end;
|
|
@@ -1065,27 +1065,27 @@ implementation
|
|
|
begin
|
|
|
if (tai_label(hp).labsym.bind=AB_PRIVATE_EXTERN) then
|
|
|
begin
|
|
|
- AsmWrite(#9'.private_extern ');
|
|
|
- AsmWriteln(tai_label(hp).labsym.name);
|
|
|
+ writer.AsmWrite(#9'.private_extern ');
|
|
|
+ writer.AsmWriteln(tai_label(hp).labsym.name);
|
|
|
end;
|
|
|
if tai_label(hp).labsym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN] then
|
|
|
begin
|
|
|
{$ifdef arm}
|
|
|
{ do no change arm mode accidently, .globl seems to reset the mode }
|
|
|
if GenerateThumbCode or GenerateThumb2Code then
|
|
|
- AsmWriteln(#9'.thumb_func'#9);
|
|
|
+ writer.AsmWriteln(#9'.thumb_func'#9);
|
|
|
{$endif arm}
|
|
|
- AsmWrite('.globl'#9);
|
|
|
+ writer.AsmWrite('.globl'#9);
|
|
|
if replaceforbidden then
|
|
|
- AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_label(hp).labsym.name))
|
|
|
+ writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_label(hp).labsym.name))
|
|
|
else
|
|
|
- AsmWriteLn(tai_label(hp).labsym.name);
|
|
|
+ writer.AsmWriteLn(tai_label(hp).labsym.name);
|
|
|
end;
|
|
|
if replaceforbidden then
|
|
|
- AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_label(hp).labsym.name))
|
|
|
+ writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_label(hp).labsym.name))
|
|
|
else
|
|
|
- AsmWrite(tai_label(hp).labsym.name);
|
|
|
- AsmWriteLn(':');
|
|
|
+ writer.AsmWrite(tai_label(hp).labsym.name);
|
|
|
+ writer.AsmWriteLn(':');
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -1093,40 +1093,40 @@ implementation
|
|
|
begin
|
|
|
if (tai_symbol(hp).sym.bind=AB_PRIVATE_EXTERN) then
|
|
|
begin
|
|
|
- AsmWrite(#9'.private_extern ');
|
|
|
+ writer.AsmWrite(#9'.private_extern ');
|
|
|
if replaceforbidden then
|
|
|
- AsmWriteln(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name))
|
|
|
+ writer.AsmWriteln(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name))
|
|
|
else
|
|
|
- AsmWriteln(tai_symbol(hp).sym.name);
|
|
|
+ writer.AsmWriteln(tai_symbol(hp).sym.name);
|
|
|
end;
|
|
|
if (target_info.system=system_powerpc64_linux) and
|
|
|
(tai_symbol(hp).sym.typ=AT_FUNCTION) and
|
|
|
(cs_profile in current_settings.moduleswitches) then
|
|
|
- AsmWriteLn('.globl _mcount');
|
|
|
+ writer.AsmWriteLn('.globl _mcount');
|
|
|
|
|
|
if tai_symbol(hp).is_global then
|
|
|
begin
|
|
|
- AsmWrite('.globl'#9);
|
|
|
+ writer.AsmWrite('.globl'#9);
|
|
|
if replaceforbidden then
|
|
|
- AsmWriteln(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name))
|
|
|
+ writer.AsmWriteln(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name))
|
|
|
else
|
|
|
- AsmWriteln(tai_symbol(hp).sym.name);
|
|
|
+ writer.AsmWriteln(tai_symbol(hp).sym.name);
|
|
|
end;
|
|
|
if (target_info.system=system_powerpc64_linux) and
|
|
|
use_dotted_functions and
|
|
|
(tai_symbol(hp).sym.typ=AT_FUNCTION) then
|
|
|
begin
|
|
|
- AsmWriteLn('.section ".opd", "aw"');
|
|
|
- AsmWriteLn('.align 3');
|
|
|
- AsmWriteLn(tai_symbol(hp).sym.name + ':');
|
|
|
- AsmWriteLn('.quad .' + tai_symbol(hp).sym.name + ', .TOC.@tocbase, 0');
|
|
|
- AsmWriteLn('.previous');
|
|
|
- AsmWriteLn('.size ' + tai_symbol(hp).sym.name + ', 24');
|
|
|
+ writer.AsmWriteLn('.section ".opd", "aw"');
|
|
|
+ writer.AsmWriteLn('.align 3');
|
|
|
+ writer.AsmWriteLn(tai_symbol(hp).sym.name + ':');
|
|
|
+ writer.AsmWriteLn('.quad .' + tai_symbol(hp).sym.name + ', .TOC.@tocbase, 0');
|
|
|
+ writer.AsmWriteLn('.previous');
|
|
|
+ writer.AsmWriteLn('.size ' + tai_symbol(hp).sym.name + ', 24');
|
|
|
if (tai_symbol(hp).is_global) then
|
|
|
- AsmWriteLn('.globl .' + tai_symbol(hp).sym.name);
|
|
|
- AsmWriteLn('.type .' + tai_symbol(hp).sym.name + ', @function');
|
|
|
+ writer.AsmWriteLn('.globl .' + tai_symbol(hp).sym.name);
|
|
|
+ writer.AsmWriteLn('.type .' + tai_symbol(hp).sym.name + ', @function');
|
|
|
{ the dotted name is the name of the actual function entry }
|
|
|
- AsmWrite('.');
|
|
|
+ writer.AsmWrite('.');
|
|
|
end
|
|
|
else if (target_info.system in systems_aix) and
|
|
|
(tai_symbol(hp).sym.typ = AT_FUNCTION) then
|
|
@@ -1141,16 +1141,16 @@ implementation
|
|
|
s:=#9'.llong .';
|
|
|
ch:='3';
|
|
|
end;
|
|
|
- AsmWriteLn(#9'.csect '+ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name)+'[DS],'+ch);
|
|
|
- AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name)+':');
|
|
|
- AsmWriteln(s+ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name)+', TOC[tc0], 0');
|
|
|
- AsmWriteln(#9'.csect .text[PR]');
|
|
|
+ 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 .text[PR]');
|
|
|
if (tai_symbol(hp).is_global) then
|
|
|
- AsmWriteLn('.globl .'+ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name))
|
|
|
+ writer.AsmWriteLn('.globl .'+ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name))
|
|
|
else
|
|
|
- AsmWriteLn('.lglobl .'+ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name));
|
|
|
+ writer.AsmWriteLn('.lglobl .'+ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name));
|
|
|
{ the dotted name is the name of the actual function entry }
|
|
|
- AsmWrite('.');
|
|
|
+ writer.AsmWrite('.');
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
@@ -1160,28 +1160,28 @@ implementation
|
|
|
sepChar := '#';
|
|
|
if (tf_needs_symbol_type in target_info.flags) then
|
|
|
begin
|
|
|
- AsmWrite(#9'.type'#9 + tai_symbol(hp).sym.name);
|
|
|
+ writer.AsmWrite(#9'.type'#9 + tai_symbol(hp).sym.name);
|
|
|
if (needsObject(tai_symbol(hp))) then
|
|
|
- AsmWriteLn(',' + sepChar + 'object')
|
|
|
+ writer.AsmWriteLn(',' + sepChar + 'object')
|
|
|
else
|
|
|
- AsmWriteLn(',' + sepChar + 'function');
|
|
|
+ writer.AsmWriteLn(',' + sepChar + 'function');
|
|
|
end;
|
|
|
end;
|
|
|
if replaceforbidden then
|
|
|
if not(tai_symbol(hp).has_value) then
|
|
|
- AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name + ':'))
|
|
|
+ writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name + ':'))
|
|
|
else
|
|
|
- AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name + '=' + tostr(tai_symbol(hp).value)))
|
|
|
+ writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol(hp).sym.name + '=' + tostr(tai_symbol(hp).value)))
|
|
|
else if not(tai_symbol(hp).has_value) then
|
|
|
- AsmWriteLn(tai_symbol(hp).sym.name + ':')
|
|
|
+ writer.AsmWriteLn(tai_symbol(hp).sym.name + ':')
|
|
|
else
|
|
|
- AsmWriteLn(tai_symbol(hp).sym.name + '=' + tostr(tai_symbol(hp).value));
|
|
|
+ writer.AsmWriteLn(tai_symbol(hp).sym.name + '=' + tostr(tai_symbol(hp).value));
|
|
|
end;
|
|
|
ait_symbolpair:
|
|
|
begin
|
|
|
- AsmWrite(#9);
|
|
|
- AsmWrite(symbolpairkindstr[tai_symbolpair(hp).kind]);
|
|
|
- AsmWrite(' ');
|
|
|
+ writer.AsmWrite(#9);
|
|
|
+ writer.AsmWrite(symbolpairkindstr[tai_symbolpair(hp).kind]);
|
|
|
+ writer.AsmWrite(' ');
|
|
|
if tai_symbolpair(hp).kind<>spk_localentry then
|
|
|
s:=', '
|
|
|
else
|
|
@@ -1191,22 +1191,22 @@ implementation
|
|
|
if replaceforbidden then
|
|
|
begin
|
|
|
{ avoid string truncation }
|
|
|
- AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_symbolpair(hp).sym^)+s);
|
|
|
- AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbolpair(hp).value^));
|
|
|
+ writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_symbolpair(hp).sym^)+s);
|
|
|
+ writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbolpair(hp).value^));
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
{ avoid string truncation }
|
|
|
- AsmWrite(tai_symbolpair(hp).sym^+s);
|
|
|
- AsmWriteLn(tai_symbolpair(hp).value^);
|
|
|
+ writer.AsmWrite(tai_symbolpair(hp).sym^+s);
|
|
|
+ writer.AsmWriteLn(tai_symbolpair(hp).value^);
|
|
|
end;
|
|
|
end;
|
|
|
ait_weak:
|
|
|
begin
|
|
|
if replaceforbidden then
|
|
|
- AsmWriteLn(#9'.weak '+ReplaceForbiddenAsmSymbolChars(tai_weak(hp).sym^))
|
|
|
+ writer.AsmWriteLn(#9'.weak '+ReplaceForbiddenAsmSymbolChars(tai_weak(hp).sym^))
|
|
|
else
|
|
|
- AsmWriteLn(#9'.weak '+tai_weak(hp).sym^);
|
|
|
+ writer.AsmWriteLn(#9'.weak '+tai_weak(hp).sym^);
|
|
|
end;
|
|
|
ait_symbol_end :
|
|
|
begin
|
|
@@ -1214,25 +1214,25 @@ implementation
|
|
|
begin
|
|
|
s:=target_asm.labelprefix+'e'+tostr(symendcount);
|
|
|
inc(symendcount);
|
|
|
- AsmWriteLn(s+':');
|
|
|
- AsmWrite(#9'.size'#9);
|
|
|
+ writer.AsmWriteLn(s+':');
|
|
|
+ writer.AsmWrite(#9'.size'#9);
|
|
|
if (target_info.system=system_powerpc64_linux) and
|
|
|
use_dotted_functions and
|
|
|
(tai_symbol_end(hp).sym.typ=AT_FUNCTION) then
|
|
|
- AsmWrite('.');
|
|
|
+ writer.AsmWrite('.');
|
|
|
if replaceforbidden then
|
|
|
- AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_symbol_end(hp).sym.name))
|
|
|
+ writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_symbol_end(hp).sym.name))
|
|
|
else
|
|
|
- AsmWrite(tai_symbol_end(hp).sym.name);
|
|
|
- AsmWrite(', '+s+' - ');
|
|
|
+ writer.AsmWrite(tai_symbol_end(hp).sym.name);
|
|
|
+ writer.AsmWrite(', '+s+' - ');
|
|
|
if (target_info.system=system_powerpc64_linux) and
|
|
|
use_dotted_functions and
|
|
|
(tai_symbol_end(hp).sym.typ=AT_FUNCTION) then
|
|
|
- AsmWrite('.');
|
|
|
+ writer.AsmWrite('.');
|
|
|
if replaceforbidden then
|
|
|
- AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol_end(hp).sym.name))
|
|
|
+ writer.AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_symbol_end(hp).sym.name))
|
|
|
else
|
|
|
- AsmWriteLn(tai_symbol_end(hp).sym.name);
|
|
|
+ writer.AsmWriteLn(tai_symbol_end(hp).sym.name);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -1245,9 +1245,9 @@ implementation
|
|
|
begin
|
|
|
if assigned(tai_stab(hp).str) then
|
|
|
begin
|
|
|
- AsmWrite(#9'.'+stabtypestr[tai_stab(hp).stabtype]+' ');
|
|
|
- AsmWritePChar(tai_stab(hp).str);
|
|
|
- AsmLn;
|
|
|
+ writer.AsmWrite(#9'.'+stabtypestr[tai_stab(hp).stabtype]+' ');
|
|
|
+ writer.AsmWritePChar(tai_stab(hp).str);
|
|
|
+ writer.AsmLn;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -1256,25 +1256,23 @@ implementation
|
|
|
begin
|
|
|
{$ifdef DEBUG_AGGAS}
|
|
|
WriteStr(s,hp.typ);
|
|
|
- AsmWriteLn('# '+s);
|
|
|
+ writer.AsmWriteLn('# '+s);
|
|
|
{$endif DEBUG_AGGAS}
|
|
|
end;
|
|
|
|
|
|
ait_cutobject :
|
|
|
begin
|
|
|
{$ifdef DEBUG_AGGAS}
|
|
|
- AsmWriteLn('# ait_cutobject');
|
|
|
+ writer.AsmWriteLn('# ait_cutobject');
|
|
|
{$endif DEBUG_AGGAS}
|
|
|
if SmartAsm then
|
|
|
begin
|
|
|
{ only reset buffer if nothing has changed }
|
|
|
- if AsmSize=AsmStartSize then
|
|
|
- AsmClear
|
|
|
- else
|
|
|
+ if not(writer.ClearIfEmpty) then
|
|
|
begin
|
|
|
- AsmClose;
|
|
|
+ writer.AsmClose;
|
|
|
DoAssemble;
|
|
|
- AsmCreate(tai_cutobject(hp).place);
|
|
|
+ writer.AsmCreate(tai_cutobject(hp).place);
|
|
|
end;
|
|
|
{ avoid empty files }
|
|
|
while assigned(hp.next) and (tai(hp.next).typ in [ait_cutobject,ait_section,ait_comment]) do
|
|
@@ -1285,7 +1283,7 @@ implementation
|
|
|
end;
|
|
|
if LastSecType<>sec_none then
|
|
|
WriteSection(LastSecType,'',secorder_default,last_align);
|
|
|
- AsmStartSize:=AsmSize;
|
|
|
+ writer.MarkEmpty;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -1293,7 +1291,7 @@ implementation
|
|
|
begin
|
|
|
{$ifdef DEBUG_AGGAS}
|
|
|
WriteStr(s,tai_marker(hp).Kind);
|
|
|
- AsmWriteLn('# ait_marker, kind: '+s);
|
|
|
+ writer.AsmWriteLn('# ait_marker, kind: '+s);
|
|
|
{$endif DEBUG_AGGAS}
|
|
|
if tai_marker(hp).kind=mark_NoLineInfoStart then
|
|
|
inc(InlineLevel)
|
|
@@ -1307,48 +1305,48 @@ implementation
|
|
|
if tai_directive(hp).name <>'' then
|
|
|
begin
|
|
|
if replaceforbidden then
|
|
|
- AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_directive(hp).name))
|
|
|
+ writer.AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_directive(hp).name))
|
|
|
else
|
|
|
- AsmWrite(tai_directive(hp).name);
|
|
|
+ writer.AsmWrite(tai_directive(hp).name);
|
|
|
end;
|
|
|
- AsmLn;
|
|
|
+ writer.AsmLn;
|
|
|
end;
|
|
|
|
|
|
ait_seh_directive :
|
|
|
begin
|
|
|
{$ifndef DISABLE_WIN64_SEH}
|
|
|
- AsmWrite(sehdirectivestr[tai_seh_directive(hp).kind]);
|
|
|
+ writer.AsmWrite(sehdirectivestr[tai_seh_directive(hp).kind]);
|
|
|
case tai_seh_directive(hp).datatype of
|
|
|
sd_none:;
|
|
|
sd_string:
|
|
|
begin
|
|
|
- AsmWrite(' '+tai_seh_directive(hp).data.name^);
|
|
|
+ writer.AsmWrite(' '+tai_seh_directive(hp).data.name^);
|
|
|
if (tai_seh_directive(hp).data.flags and 1)<>0 then
|
|
|
- AsmWrite(',@except');
|
|
|
+ writer.AsmWrite(',@except');
|
|
|
if (tai_seh_directive(hp).data.flags and 2)<>0 then
|
|
|
- AsmWrite(',@unwind');
|
|
|
+ writer.AsmWrite(',@unwind');
|
|
|
end;
|
|
|
sd_reg:
|
|
|
- AsmWrite(' '+gas_regname(tai_seh_directive(hp).data.reg));
|
|
|
+ writer.AsmWrite(' '+gas_regname(tai_seh_directive(hp).data.reg));
|
|
|
sd_offset:
|
|
|
- AsmWrite(' '+tostr(tai_seh_directive(hp).data.offset));
|
|
|
+ writer.AsmWrite(' '+tostr(tai_seh_directive(hp).data.offset));
|
|
|
sd_regoffset:
|
|
|
- AsmWrite(' '+gas_regname(tai_seh_directive(hp).data.reg)+', '+
|
|
|
+ writer.AsmWrite(' '+gas_regname(tai_seh_directive(hp).data.reg)+', '+
|
|
|
tostr(tai_seh_directive(hp).data.offset));
|
|
|
end;
|
|
|
- AsmLn;
|
|
|
+ writer.AsmLn;
|
|
|
{$endif DISABLE_WIN64_SEH}
|
|
|
end;
|
|
|
|
|
|
ait_varloc:
|
|
|
begin
|
|
|
if tai_varloc(hp).newlocationhi<>NR_NO then
|
|
|
- AsmWrite(strpnew('Var '+tai_varloc(hp).varsym.realname+' located in register '+
|
|
|
+ writer.AsmWrite(strpnew('Var '+tai_varloc(hp).varsym.realname+' located in register '+
|
|
|
std_regname(tai_varloc(hp).newlocationhi)+':'+std_regname(tai_varloc(hp).newlocation)))
|
|
|
else
|
|
|
- AsmWrite(strpnew('Var '+tai_varloc(hp).varsym.realname+' located in register '+
|
|
|
+ writer.AsmWrite(strpnew('Var '+tai_varloc(hp).varsym.realname+' located in register '+
|
|
|
std_regname(tai_varloc(hp).newlocation)));
|
|
|
- AsmLn;
|
|
|
+ writer.AsmLn;
|
|
|
end;
|
|
|
else
|
|
|
internalerror(2006012201);
|
|
@@ -1377,7 +1375,7 @@ implementation
|
|
|
|
|
|
procedure TGNUAssembler.WriteWeakSymbolDef(s: tasmsymbol);
|
|
|
begin
|
|
|
- AsmWriteLn(#9'.weak '+s.name);
|
|
|
+ writer.AsmWriteLn(#9'.weak '+s.name);
|
|
|
end;
|
|
|
|
|
|
|
|
@@ -1397,11 +1395,11 @@ implementation
|
|
|
case terminationkind of
|
|
|
term_none: ;
|
|
|
term_string:
|
|
|
- AsmWriteLn('"');
|
|
|
+ writer.AsmWriteLn('"');
|
|
|
term_nostring:
|
|
|
- AsmLn;
|
|
|
+ writer.AsmLn;
|
|
|
end;
|
|
|
- AsmWrite(#9'.byte'#9);
|
|
|
+ writer.AsmWrite(#9'.byte'#9);
|
|
|
pos:=20;
|
|
|
instring:=false;
|
|
|
end;
|
|
@@ -1446,14 +1444,14 @@ implementation
|
|
|
else
|
|
|
s:=ch;
|
|
|
end;
|
|
|
- AsmWrite(s);
|
|
|
+ writer.AsmWrite(s);
|
|
|
inc(pos,length(s));
|
|
|
if (pos>line_length) or (i=tai_string(hp).len) then
|
|
|
begin
|
|
|
if instring then
|
|
|
- AsmWriteLn('"')
|
|
|
+ writer.AsmWriteLn('"')
|
|
|
else
|
|
|
- AsmLn;
|
|
|
+ writer.AsmLn;
|
|
|
pos:=0;
|
|
|
end;
|
|
|
end;
|
|
@@ -1472,17 +1470,17 @@ implementation
|
|
|
size:=tai_const(hp).size;
|
|
|
while pos<(size-4) do
|
|
|
begin
|
|
|
- AsmWrite(#9'.vbyte'#9'4, ');
|
|
|
- AsmWriteln(tostr(longint(tai_const(hp).value shr ((size-pos-4)*8))));
|
|
|
+ writer.AsmWrite(#9'.vbyte'#9'4, ');
|
|
|
+ writer.AsmWriteln(tostr(longint(tai_const(hp).value shr ((size-pos-4)*8))));
|
|
|
inc(pos,4);
|
|
|
end;
|
|
|
- AsmWrite(#9'.vbyte'#9);
|
|
|
- AsmWrite(tostr(size-pos));
|
|
|
- AsmWrite(', ');
|
|
|
+ writer.AsmWrite(#9'.vbyte'#9);
|
|
|
+ writer.AsmWrite(tostr(size-pos));
|
|
|
+ writer.AsmWrite(', ');
|
|
|
case size-pos of
|
|
|
- 1: AsmWrite(tostr(byte(tai_const(hp).value)));
|
|
|
- 2: AsmWrite(tostr(word(tai_const(hp).value)));
|
|
|
- 4: AsmWrite(tostr(longint(tai_const(hp).value)));
|
|
|
+ 1: writer.AsmWrite(tostr(byte(tai_const(hp).value)));
|
|
|
+ 2: writer.AsmWrite(tostr(word(tai_const(hp).value)));
|
|
|
+ 4: writer.AsmWrite(tostr(longint(tai_const(hp).value)));
|
|
|
else
|
|
|
internalerror(2012010402);
|
|
|
end;
|
|
@@ -1493,18 +1491,18 @@ implementation
|
|
|
pos, size: longint;
|
|
|
begin
|
|
|
size:=tai_const(hp).size;
|
|
|
- AsmWrite(#9'.byte'#9);
|
|
|
+ writer.AsmWrite(#9'.byte'#9);
|
|
|
if target_info.endian=endian_big then
|
|
|
begin
|
|
|
pos:=size-1;
|
|
|
while pos>=0 do
|
|
|
begin
|
|
|
- AsmWrite(tostr((tai_const(hp).value shr (pos*8)) and $ff));
|
|
|
+ writer.AsmWrite(tostr((tai_const(hp).value shr (pos*8)) and $ff));
|
|
|
dec(pos);
|
|
|
if pos>=0 then
|
|
|
- AsmWrite(', ')
|
|
|
+ writer.AsmWrite(', ')
|
|
|
else
|
|
|
- AsmLn;
|
|
|
+ writer.AsmLn;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
@@ -1512,21 +1510,21 @@ implementation
|
|
|
pos:=0;
|
|
|
while pos<size do
|
|
|
begin
|
|
|
- AsmWriteln(tostr((tai_const(hp).value shr (pos*8)) and $ff));
|
|
|
+ writer.AsmWriteln(tostr((tai_const(hp).value shr (pos*8)) and $ff));
|
|
|
inc(pos);
|
|
|
if pos<=size then
|
|
|
- AsmWrite(', ')
|
|
|
+ writer.AsmWrite(', ')
|
|
|
else
|
|
|
- AsmLn;
|
|
|
+ writer.AsmLn;
|
|
|
end;
|
|
|
end;
|
|
|
- AsmLn;
|
|
|
+ writer.AsmLn;
|
|
|
end;
|
|
|
|
|
|
|
|
|
procedure TGNUAssembler.WriteDirectiveName(dir: TAsmDirective);
|
|
|
begin
|
|
|
- AsmWrite('.'+directivestr[dir]+' ');
|
|
|
+ writer.AsmWrite('.'+directivestr[dir]+' ');
|
|
|
end;
|
|
|
|
|
|
|
|
@@ -1550,19 +1548,19 @@ implementation
|
|
|
TARGET_ASM_FILE_START_FILE_DIRECTIVE in gcc/config/*.h
|
|
|
}
|
|
|
if not(target_info.system in systems_darwin) then
|
|
|
- AsmWriteLn(#9'.file "'+FixFileName(n)+'"');
|
|
|
+ writer.AsmWriteLn(#9'.file "'+FixFileName(n)+'"');
|
|
|
|
|
|
WriteExtraHeader;
|
|
|
- AsmStartSize:=AsmSize;
|
|
|
+ writer.MarkEmpty;
|
|
|
symendcount:=0;
|
|
|
|
|
|
for hal:=low(TasmlistType) to high(TasmlistType) do
|
|
|
begin
|
|
|
if not (current_asmdata.asmlists[hal].empty) then
|
|
|
begin
|
|
|
- AsmWriteLn(target_asm.comment+'Begin asmlist '+AsmlistTypeStr[hal]);
|
|
|
+ writer.AsmWriteLn(target_asm.comment+'Begin asmlist '+AsmlistTypeStr[hal]);
|
|
|
writetree(current_asmdata.asmlists[hal]);
|
|
|
- AsmWriteLn(target_asm.comment+'End asmlist '+AsmlistTypeStr[hal]);
|
|
|
+ writer.AsmWriteLn(target_asm.comment+'End asmlist '+AsmlistTypeStr[hal]);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -1573,17 +1571,17 @@ implementation
|
|
|
|
|
|
if create_smartlink_sections and
|
|
|
(target_info.system in systems_darwin) then
|
|
|
- AsmWriteLn(#9'.subsections_via_symbols');
|
|
|
+ writer.AsmWriteLn(#9'.subsections_via_symbols');
|
|
|
|
|
|
{ "no executable stack" marker }
|
|
|
{ TODO: used by OpenBSD/NetBSD as well? }
|
|
|
if (target_info.system in (systems_linux + systems_android + systems_freebsd + systems_dragonfly)) and
|
|
|
not(cs_executable_stack in current_settings.moduleswitches) then
|
|
|
begin
|
|
|
- AsmWriteLn('.section .note.GNU-stack,"",%progbits');
|
|
|
+ writer.AsmWriteLn('.section .note.GNU-stack,"",%progbits');
|
|
|
end;
|
|
|
|
|
|
- AsmLn;
|
|
|
+ writer.AsmLn;
|
|
|
WriteExtraFooter;
|
|
|
{$ifdef EXTDEBUG}
|
|
|
if current_module.mainsource<>'' then
|
|
@@ -1800,7 +1798,7 @@ implementation
|
|
|
|
|
|
procedure TAppleGNUAssembler.WriteWeakSymbolDef(s: tasmsymbol);
|
|
|
begin
|
|
|
- AsmWriteLn(#9'.weak_reference '+s.name);
|
|
|
+ writer.AsmWriteLn(#9'.weak_reference '+s.name);
|
|
|
end;
|
|
|
|
|
|
|