Browse Source

* alignment of dwarf sections

git-svn-id: trunk@3059 -
peter 19 years ago
parent
commit
f9ccac3f30
3 changed files with 14 additions and 15 deletions
  1. 4 1
      compiler/ogbase.pas
  2. 5 2
      compiler/ogcoff.pas
  3. 5 12
      compiler/ogelf.pas

+ 4 - 1
compiler/ogbase.pas

@@ -728,7 +728,10 @@ implementation
 
     function TObjData.sectiontype2align(atype:TAsmSectiontype):shortint;
       begin
-        result:=sizeof(aint);
+        if atype in [sec_stabstr,sec_debug_info,sec_debug_line,sec_debug_abbrev] then
+          result:=1
+        else
+          result:=sizeof(aint);
       end;
 
 

+ 5 - 2
compiler/ogcoff.pas

@@ -834,8 +834,11 @@ const win32stub : array[0..131] of byte=(
 
     procedure TCoffObjData.CreateDebugSections;
       begin
-        stabssec:=createsection(sec_stab,'');
-        stabstrsec:=createsection(sec_stabstr,'');
+        if target_dbg.id=dbg_stabs then
+          begin
+            stabssec:=createsection(sec_stab,'');
+            stabstrsec:=createsection(sec_stabstr,'');
+          end;
       end;
 
 

+ 5 - 12
compiler/ogelf.pas

@@ -67,7 +67,6 @@ interface
          constructor create(const n:string);override;
          destructor  destroy;override;
          function  sectionname(atype:TAsmSectiontype;const aname:string):string;override;
-         function  sectiontype2align(atype:TAsmSectiontype):shortint;override;
          procedure CreateDebugSections;override;
          procedure writereloc(data,len:aint;p:TObjSymbol;relative:TObjRelocationType);override;
          procedure writestab(offset:aint;ps:TObjSymbol;nidx,nother:byte;ndesc:word;p:pchar);override;
@@ -611,19 +610,13 @@ implementation
       end;
 
 
-    function TElfObjData.sectiontype2align(atype:TAsmSectiontype):shortint;
-      begin
-        if atype=sec_stabstr then
-          result:=1
-        else
-          result:=sizeof(aint);
-      end;
-
-
     procedure TElfObjData.CreateDebugSections;
       begin
-        stabssec:=createsection(sec_stab,'');
-        stabstrsec:=createsection(sec_stabstr,'');
+        if target_dbg.id=dbg_stabs then
+          begin
+            stabssec:=createsection(sec_stab,'');
+            stabstrsec:=createsection(sec_stabstr,'');
+          end;
       end;