Browse Source

* big endian fix in TOmfObjData.writeReloc

Nikolay Nikolov 1 year ago
parent
commit
49ce3f5d2a
1 changed files with 10 additions and 1 deletions
  1. 10 1
      compiler/ogomf.pas

+ 10 - 1
compiler/ogomf.pas

@@ -1241,7 +1241,16 @@ implementation
                 objreloc:=TOmfRelocation.CreateGroup(CurrObjSec.Size,TObjSectionGroup(GroupsList.Find('DGROUP')),RELOC_SEGREL);
                 objreloc:=TOmfRelocation.CreateGroup(CurrObjSec.Size,TObjSectionGroup(GroupsList.Find('DGROUP')),RELOC_SEGREL);
               CurrObjSec.ObjRelocations.Add(objreloc);
               CurrObjSec.ObjRelocations.Add(objreloc);
             end;
             end;
-        CurrObjSec.write(data,len);
+        case len of
+          1:
+            CurrObjSec.write(data,1);
+          2:
+            CurrObjSec.writeInt16LE(int16(data));
+          4:
+            CurrObjSec.writeInt32LE(int32(data));
+          else
+            internalerror(2023110201);
+        end;
       end;
       end;
 
 
     procedure TOmfObjData.AddImportSymbol(const libname, symname,
     procedure TOmfObjData.AddImportSymbol(const libname, symname,