瀏覽代碼

Add missing swaping in case of different endianess of stab entry inside TInternalAssembler.WriteStab

Pierre Muller 2 年之前
父節點
當前提交
144ee6d51d
共有 2 個文件被更改,包括 2 次插入0 次删除
  1. 1 0
      compiler/assemble.pas
  2. 1 0
      compiler/ogbase.pas

+ 1 - 0
compiler/assemble.pas

@@ -1628,6 +1628,7 @@ Implementation
               write a the value field with relocation }
             oldsec:=ObjData.CurrObjSec;
             ObjData.SetSection(ObjData.StabsSec);
+	    MaybeSwapStab(stab);
             ObjData.Writebytes(stab,sizeof(TObjStabEntry)-4);
             ObjData.Writereloc(stab.nvalue,4,relocsym,RELOC_ABSOLUTE32);
             ObjData.setsection(oldsec);

+ 1 - 0
compiler/ogbase.pas

@@ -757,6 +757,7 @@ interface
     function align_aword(v:aword;a:longword):aword;
     function align_qword(v:qword;a:longword):qword;
     function align_objsecofs(v:TObjSectionOfs;a:longword):TObjSectionOfs;
+    procedure MaybeSwapStab(var v:TObjStabEntry);
 
 implementation