Forráskód Böngészése

Merged revisions 12352,12437 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r12352 | yury | 2008-12-12 16:54:14 +0200 (Пт, 12 дек 2008) | 1 line

* Do not write COFF string table into EXE if COFF symbol table is not present. It fixes loading of stripped DLL on Win9x. Bug #12629.
........
r12437 | yury | 2008-12-25 12:14:34 +0200 (Чт, 25 дек 2008) | 1 line

* Fixed .res resources handling when -o switch is used to specify executable full path and name in the same folder where .res files are located. Mantis #12856.
........

git-svn-id: branches/fixes_2_2@12439 -

yury 16 éve
szülő
commit
a21b7e45b3
2 módosított fájl, 16 hozzáadás és 12 törlés
  1. 2 2
      compiler/comprsrc.pas
  2. 14 10
      compiler/ogcoff.pas

+ 2 - 2
compiler/comprsrc.pas

@@ -387,7 +387,7 @@ begin
     same with MacOS}
   if target_info.system in [system_i386_os2,system_i386_emx,system_powerpc_macos] then exit;
 
-  p:=ExtractFilePath(current_module.mainsource^);
+  p:=ExtractFilePath(ExpandFileName(current_module.mainsource^));
   res:=TCmdStrListItem(current_module.ResourceFiles.First);
   while res<>nil do
     begin
@@ -400,7 +400,7 @@ begin
       if resourcefile.IsCompiled(s) then
         begin
           resourcefile.free;
-          if CompareText(current_module.outputpath^, p) <> 0 then
+          if AnsiCompareFileName(IncludeTrailingPathDelimiter(ExpandFileName(current_module.outputpath^)), p) <> 0 then
             begin
               { Copy .res file to units output dir }
               res.FPStr:=ExtractFileName(res.FPStr);

+ 14 - 10
compiler/ogcoff.pas

@@ -2164,9 +2164,11 @@ const pemagic : array[0..3] of byte = (
         fillchar(header,sizeof(header),0);
         header.mach:=COFF_MAGIC;
         header.nsects:=nsects;
-        header.sympos:=sympos;
         if hassymbols then
-          header.syms:=nsyms;
+          begin
+            header.sympos:=sympos;
+            header.syms:=nsyms;
+          end;
         if win32 then
           header.opthdr:=sizeof(tcoffpeoptheader)
         else
@@ -2274,15 +2276,17 @@ const pemagic : array[0..3] of byte = (
         ExeSectionList.ForEachCall(@ExeSectionList_write_header,nil);
         { Section data }
         ExeSectionList.ForEachCall(@ExeSectionList_write_data,nil);
-        { Optional Symbols }
-        if SymPos<>FWriter.Size then
-          internalerror(200602252);
         if hassymbols then
-          ExeSymbolList.ForEachCall(@globalsyms_write_symbol,nil);
-        { Strings }
-        i:=FCoffStrs.size+4;
-        FWriter.write(i,4);
-        FWriter.writearray(FCoffStrs);
+          begin
+            { Optional Symbols }
+            if SymPos<>FWriter.Size then
+              internalerror(200602252);
+            ExeSymbolList.ForEachCall(@globalsyms_write_symbol,nil);
+            { Strings }
+            i:=FCoffStrs.size+4;
+            FWriter.write(i,4);
+            FWriter.writearray(FCoffStrs);
+          end;
         { Release }
         FCoffStrs.Free;
         FCoffSyms.Free;