Browse Source

* don't add the stack segment declaration at the beginning of each object file
in the i8086 far data memory models as well

git-svn-id: trunk@28022 -

nickysn 11 years ago
parent
commit
36d6fb7868
1 changed files with 6 additions and 1 deletions
  1. 6 1
      compiler/x86/agx86nsm.pas

+ 6 - 1
compiler/x86/agx86nsm.pas

@@ -579,6 +579,10 @@ interface
         else if secnames[atype]='.text' then
         else if secnames[atype]='.text' then
           AsmWrite(CodeSectionName(aname))
           AsmWrite(CodeSectionName(aname))
 {$ifdef i8086}
 {$ifdef i8086}
+        else if (target_info.system=system_i8086_msdos) and
+                (atype=sec_stack) and
+                (current_settings.x86memorymodel in x86_far_data_models) then
+          AsmWrite('stack stack class=stack align=16')
         else if (target_info.system=system_i8086_msdos) and
         else if (target_info.system=system_i8086_msdos) and
                 (atype=sec_heap) and
                 (atype=sec_heap) and
                 (current_settings.x86memorymodel in x86_far_data_models) then
                 (current_settings.x86memorymodel in x86_far_data_models) then
@@ -1222,7 +1226,8 @@ interface
       AsmWriteLn('SECTION .fpc class=data');
       AsmWriteLn('SECTION .fpc class=data');
       { WLINK requires class=bss in order to leave the BSS section out of the executable }
       { WLINK requires class=bss in order to leave the BSS section out of the executable }
       AsmWriteLn('SECTION .bss class=bss');
       AsmWriteLn('SECTION .bss class=bss');
-      if current_settings.x86memorymodel<>mm_tiny then
+      if (current_settings.x86memorymodel<>mm_tiny) and
+         (current_settings.x86memorymodel in x86_near_data_models) then
         AsmWriteLn('SECTION stack stack class=stack align=16');
         AsmWriteLn('SECTION stack stack class=stack align=16');
       if current_settings.x86memorymodel in x86_near_data_models then
       if current_settings.x86memorymodel in x86_near_data_models then
         AsmWriteLn('SECTION heap class=heap align=16');
         AsmWriteLn('SECTION heap class=heap align=16');