Browse Source

* use a 4 byte alignment for the dwarf debug sections on i8086 (not sure if
that's correct for 16-bit dwarf, but currently the compiler emits 4-byte
tai_aligns, so setting the section alignment to 4 avoids problems in the
internal object writer)

git-svn-id: trunk@30685 -

nickysn 10 years ago
parent
commit
778a678956
2 changed files with 7 additions and 5 deletions
  1. 3 1
      compiler/ogomf.pas
  2. 4 4
      compiler/x86/agx86nsm.pas

+ 3 - 1
compiler/ogomf.pas

@@ -325,7 +325,7 @@ implementation
     function TOmfObjData.sectiontype2align(atype: TAsmSectiontype): shortint;
       begin
         case atype of
-          sec_stabstr,sec_debug_info,sec_debug_line,sec_debug_abbrev:
+          sec_stabstr:
             result:=1;
           sec_code:
             result:=1;
@@ -342,6 +342,8 @@ implementation
             be packed without gaps. }
           sec_idata2,sec_idata4,sec_idata5,sec_idata6,sec_idata7,sec_pdata:
             result:=4;
+          sec_debug_frame,sec_debug_info,sec_debug_line,sec_debug_abbrev:
+            result:=4;
           sec_stack,
           sec_heap:
             result:=16;

+ 4 - 4
compiler/x86/agx86nsm.pas

@@ -1100,10 +1100,10 @@ interface
         AsmWriteLn('GROUP dgroup rodata data fpc bss');
       if paratargetdbg in [dbg_dwarf2,dbg_dwarf3,dbg_dwarf4] then
         begin
-          AsmWriteLn('SECTION .debug_frame  use32 class=DWARF');
-          AsmWriteLn('SECTION .debug_info   use32 class=DWARF');
-          AsmWriteLn('SECTION .debug_line   use32 class=DWARF');
-          AsmWriteLn('SECTION .debug_abbrev use32 class=DWARF');
+          AsmWriteLn('SECTION .debug_frame  use32 class=DWARF align=4');
+          AsmWriteLn('SECTION .debug_info   use32 class=DWARF align=4');
+          AsmWriteLn('SECTION .debug_line   use32 class=DWARF align=4');
+          AsmWriteLn('SECTION .debug_abbrev use32 class=DWARF align=4');
         end;
       if not (cs_huge_code in current_settings.moduleswitches) then
         AsmWriteLn('SECTION ' + CodeSectionName(current_module.modulename^));