Explorar el Código

Merged revisions 11421-11422,11426 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r11421 | yury | 2008-07-20 23:28:37 +0300 (Вс, 20 июл 2008) | 1 line

* For some unknown reason WM 6.1 requires .idata section to be read only. Otherwise it refuses to load DLLs greater than 64KB. Earlier versions of WinCE load DLLs regardless of .idata flags.
........
r11426 | yury | 2008-07-21 01:22:57 +0300 (Пн, 21 июл 2008) | 1 line

* Use system_wince instead of [system_arm_wince,system_i386_wince].
........

git-svn-id: branches/rc_2_2_2@11428 -

yury hace 17 años
padre
commit
f817047758
Se han modificado 1 ficheros con 13 adiciones y 1 borrados
  1. 13 1
      compiler/ogcoff.pas

+ 13 - 1
compiler/ogcoff.pas

@@ -2113,7 +2113,8 @@ const pemagic : array[0..3] of byte = (
         peoptheader : tcoffpeoptheader;
         textExeSec,
         dataExeSec,
-        bssExeSec   : TExeSection;
+        bssExeSec,
+        idataExeSec : TExeSection;
         hassymbols  : boolean;
 
         procedure UpdateDataDir(const secname:string;idx:longint);
@@ -2248,6 +2249,17 @@ const pemagic : array[0..3] of byte = (
             djoptheader.entry:=EntrySym.offset;
             FWriter.write(djoptheader,sizeof(djoptheader));
           end;
+          
+        { For some unknown reason WM 6.1 requires .idata section to be read only.
+          Otherwise it refuses to load DLLs greater than 64KB.
+          Earlier versions of WinCE load DLLs regardless of .idata flags. }
+        if target_info.system in system_wince then
+          begin
+            idataExeSec:=FindExeSection('.idata');
+            if idataExeSec<>nil then
+              idataExeSec.SecOptions:=idataExeSec.SecOptions - [oso_write] + [oso_readonly];
+          end;
+
         { Section headers }
         ExeSectionList.ForEachCall(@ExeSectionList_write_header,nil);
         { Section data }