Ver código fonte

* Do not assume sizeof(pint) section alignment if no alignment is specified for the section.

git-svn-id: trunk@13092 -
yury 16 anos atrás
pai
commit
50060dfd52
1 arquivos alterados com 5 adições e 2 exclusões
  1. 5 2
      compiler/ogcoff.pas

+ 5 - 2
compiler/ogcoff.pas

@@ -742,7 +742,6 @@ const pemagic : array[0..3] of byte = (
         alignflag : longword;
         alignflag : longword;
       begin
       begin
         aoptions:=[];
         aoptions:=[];
-        aalign:=sizeof(pint);
         if flags and PE_SCN_CNT_CODE<>0 then
         if flags and PE_SCN_CNT_CODE<>0 then
           include(aoptions,oso_executable);
           include(aoptions,oso_executable);
         if flags and PE_SCN_MEM_DISCARDABLE<>0 then
         if flags and PE_SCN_MEM_DISCARDABLE<>0 then
@@ -774,7 +773,11 @@ const pemagic : array[0..3] of byte = (
         else if alignflag=PE_SCN_ALIGN_2BYTES then
         else if alignflag=PE_SCN_ALIGN_2BYTES then
           aalign:=2
           aalign:=2
         else if alignflag=PE_SCN_ALIGN_1BYTES then
         else if alignflag=PE_SCN_ALIGN_1BYTES then
-          aalign:=1;
+          aalign:=1
+        else if alignflag=0 then
+          aalign:=0
+        else
+          Internalerror(2009050401);
       end;
       end;