mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 11:09:19 +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
|
if (atype in [sec_rodata,sec_rodata_norel]) and
|
||||||
(target_info.system=system_i386_go32v2) then
|
(target_info.system=system_i386_go32v2) then
|
||||||
AsmWrite('.data')
|
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
|
else if secnames[atype]='.text' then
|
||||||
AsmWrite(CodeSectionName)
|
AsmWrite(CodeSectionName)
|
||||||
else
|
else
|
||||||
@ -665,11 +670,16 @@ interface
|
|||||||
|
|
||||||
ait_align :
|
ait_align :
|
||||||
begin
|
begin
|
||||||
{ nasm gives warnings when it finds align in bss as it
|
if (tai_align(hp).aligntype>1) then
|
||||||
wants to store data }
|
begin
|
||||||
if (lastsectype<>sec_bss) and
|
if (lastsectype=sec_bss) or (
|
||||||
(tai_align(hp).aligntype>1) then
|
(lastsectype=sec_threadvar) and
|
||||||
AsmWriteLn(#9'ALIGN '+tostr(tai_align(hp).aligntype));
|
(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;
|
end;
|
||||||
|
|
||||||
ait_datablock :
|
ait_datablock :
|
||||||
@ -1242,9 +1252,12 @@ interface
|
|||||||
|
|
||||||
for hal:=low(TasmlistType) to high(TasmlistType) do
|
for hal:=low(TasmlistType) to high(TasmlistType) do
|
||||||
begin
|
begin
|
||||||
AsmWriteLn(target_asm.comment+'Begin asmlist '+AsmListTypeStr[hal]);
|
if not (current_asmdata.asmlists[hal].empty) then
|
||||||
writetree(current_asmdata.asmlists[hal]);
|
begin
|
||||||
AsmWriteLn(target_asm.comment+'End asmlist '+AsmListTypeStr[hal]);
|
AsmWriteLn(target_asm.comment+'Begin asmlist '+AsmListTypeStr[hal]);
|
||||||
|
writetree(current_asmdata.asmlists[hal]);
|
||||||
|
AsmWriteLn(target_asm.comment+'End asmlist '+AsmListTypeStr[hal]);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
AsmLn;
|
AsmLn;
|
||||||
|
Loading…
Reference in New Issue
Block a user