Browse Source

* set the bss, rodata and rodata_norel section alignment to 2 bytes for the i8086-msdos target

git-svn-id: trunk@30680 -
nickysn 10 years ago
parent
commit
5a1ce6162b
3 changed files with 8 additions and 7 deletions
  1. 3 2
      compiler/ogomf.pas
  2. 3 3
      compiler/x86/agx86nsm.pas
  3. 2 2
      rtl/msdos/prt0comn.asm

+ 3 - 2
compiler/ogomf.pas

@@ -329,9 +329,10 @@ implementation
             result:=1;
           sec_code:
             result:=1;
+          sec_data,
+          sec_rodata,
+          sec_rodata_norel,
           sec_bss:
-            result:=1;
-          sec_data:
             result:=2;
           { For idata (at least idata2) it must be 4 bytes, because
             an entry is always (also in win64) 20 bytes and aligning

+ 3 - 3
compiler/x86/agx86nsm.pas

@@ -1081,11 +1081,11 @@ interface
         AsmWriteLn('SECTION ' + CodeSectionName(current_module.modulename^) + ' use16 class=code');
       { NASM complains if you put a missing section in the GROUP directive, so }
       { we add empty declarations to make sure they exist, even if empty }
-      AsmWriteLn('SECTION .rodata class=data');
-      AsmWriteLn('SECTION .data class=data');
+      AsmWriteLn('SECTION .rodata class=data align=2');
+      AsmWriteLn('SECTION .data class=data align=2');
       AsmWriteLn('SECTION .fpc class=data');
       { 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 align=2');
       if (current_settings.x86memorymodel<>mm_tiny) and
          (current_settings.x86memorymodel in x86_near_data_models) then
         AsmWriteLn('SECTION stack stack class=stack align=16');

+ 2 - 2
rtl/msdos/prt0comn.asm

@@ -489,7 +489,7 @@ FPC_CHECK_NULLAREA:
     %endif
 %endif
 
-        segment data class=data
+        segment data class=data align=2
 %ifdef __NEAR_DATA__
 mem_realloc_err_msg:
         db 'Memory allocation error', 13, 10, '$'
@@ -500,7 +500,7 @@ not_enough_mem_msg:
         ; module, containing the heap segment doesn't get smartlinked away
         dd ___heap
 
-        segment bss class=bss
+        segment bss class=bss align=2
 
 %ifndef __TINY__
         segment _NULL align=16 class=BEGDATA