Browse Source

* make sure tobjects are pointer-size aligned in case of VMT usage; fixes tw1365 on armeb-linux

git-svn-id: trunk@10544 -
micha 17 years ago
parent
commit
40211152d4
2 changed files with 5 additions and 1 deletions
  1. 4 0
      compiler/ptconst.pas
  2. 1 1
      compiler/systems/i_linux.pas

+ 4 - 0
compiler/ptconst.pas

@@ -1174,6 +1174,7 @@ implementation
           obj    : tobjectdef;
           srsym  : tsym;
           st     : tsymtable;
+          objst  : tobjectsymtable;
           curroffset : aint;
           s,sorg : TIDString;
           vmtwritten : boolean;
@@ -1249,6 +1250,9 @@ implementation
                        (oo_has_vmt in def.objectoptions) and
                        (def.vmt_offset<fieldoffset) then
                       begin
+                        objst:=tobjectsymtable(def.symtable);
+                        if objst.recordalignment<sizeof(TConstPtrUInt) then
+                          objst.recordalignment:=sizeof(TConstPtrUInt);
                         for i:=1 to def.vmt_offset-curroffset do
                           list.concat(tai_const.create_8bit(0));
                         list.concat(tai_const.createname(def.vmt_mangledname,0));

+ 1 - 1
compiler/systems/i_linux.pas

@@ -610,7 +610,7 @@ unit i_linux;
             res          : res_elf;
             dbg          : dbg_stabs;
             script       : script_unix;
-            endian       : endian_little;
+            endian       : endian_big;
             alignment    :
               (
                 procalign       : 4;