mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 07:39:25 +02:00
* Some fixes to NASM writer:
* Correctly output names of sec_user sections and sec_threadvar on Windows targets * Use ALIGNB directive to align without warnings in bss and alike sections. * Do not output 'begin/end asmlist x' for empty asmlists. git-svn-id: trunk@26898 -
This commit is contained in:
parent
f77060135c
commit
f69e6ec389
@ -577,6 +577,11 @@ interface
|
||||
if (atype in [sec_rodata,sec_rodata_norel]) and
|
||||
(target_info.system=system_i386_go32v2) then
|
||||
AsmWrite('.data')
|
||||
else if (atype=sec_user) then
|
||||
AsmWrite(aname)
|
||||
else if (atype=sec_threadvar) and
|
||||
(target_info.system in (systems_windows+systems_wince)) then
|
||||
AsmWrite('.tls'#9'bss')
|
||||
else if secnames[atype]='.text' then
|
||||
AsmWrite(CodeSectionName)
|
||||
else
|
||||
@ -665,11 +670,16 @@ interface
|
||||
|
||||
ait_align :
|
||||
begin
|
||||
{ nasm gives warnings when it finds align in bss as it
|
||||
wants to store data }
|
||||
if (lastsectype<>sec_bss) and
|
||||
(tai_align(hp).aligntype>1) then
|
||||
AsmWriteLn(#9'ALIGN '+tostr(tai_align(hp).aligntype));
|
||||
if (tai_align(hp).aligntype>1) then
|
||||
begin
|
||||
if (lastsectype=sec_bss) or (
|
||||
(lastsectype=sec_threadvar) and
|
||||
(target_info.system in (systems_windows+systems_wince))
|
||||
) then
|
||||
AsmWriteLn(#9'ALIGNB '+tostr(tai_align(hp).aligntype))
|
||||
else
|
||||
AsmWriteLn(#9'ALIGN '+tostr(tai_align(hp).aligntype));
|
||||
end;
|
||||
end;
|
||||
|
||||
ait_datablock :
|
||||
@ -1242,9 +1252,12 @@ interface
|
||||
|
||||
for hal:=low(TasmlistType) to high(TasmlistType) do
|
||||
begin
|
||||
AsmWriteLn(target_asm.comment+'Begin asmlist '+AsmListTypeStr[hal]);
|
||||
writetree(current_asmdata.asmlists[hal]);
|
||||
AsmWriteLn(target_asm.comment+'End asmlist '+AsmListTypeStr[hal]);
|
||||
if not (current_asmdata.asmlists[hal].empty) then
|
||||
begin
|
||||
AsmWriteLn(target_asm.comment+'Begin asmlist '+AsmListTypeStr[hal]);
|
||||
writetree(current_asmdata.asmlists[hal]);
|
||||
AsmWriteLn(target_asm.comment+'End asmlist '+AsmListTypeStr[hal]);
|
||||
end;
|
||||
end;
|
||||
|
||||
AsmLn;
|
||||
|
Loading…
Reference in New Issue
Block a user