Fix the -sections option of PEFIXUP tool and adapt RBUILD to use it.
authorFilip Navara <filip.navara@gmail.com>
Tue, 2 Aug 2005 18:13:21 +0000 (18:13 +0000)
committerFilip Navara <filip.navara@gmail.com>
Tue, 2 Aug 2005 18:13:21 +0000 (18:13 +0000)
svn path=/trunk/; revision=16974

reactos/tools/pefixup.c
reactos/tools/rbuild/backend/mingw/modulehandler.cpp
reactos/tools/rbuild/backend/mingw/modulehandler.h

index 251722a..9f6e9a0 100644 (file)
@@ -332,9 +332,6 @@ int main(int argc, char **argv)
            i < nt_header->OptionalHeader.NumberOfRvaAndSizes;\r
            i++, section_header++)\r
       {\r
            i < nt_header->OptionalHeader.NumberOfRvaAndSizes;\r
            i++, section_header++)\r
       {\r
-         if (section_header->VirtualAddress)\r
-        break;\r
-\r
          if (!strcmp(section_header->Name, ".text") ||\r
              !strcmp(section_header->Name, ".data") ||\r
              !strcmp(section_header->Name, ".idata") ||\r
          if (!strcmp(section_header->Name, ".text") ||\r
              !strcmp(section_header->Name, ".data") ||\r
              !strcmp(section_header->Name, ".idata") ||\r
index 7b6a9e6..c23063d 100644 (file)
@@ -1412,7 +1412,8 @@ MingwModuleHandler::GenerateLinkerCommand (
        const string& linker,
        const string& linkerParameters,
        const string& objectsMacro,
        const string& linker,
        const string& linkerParameters,
        const string& objectsMacro,
-       const string& libsMacro )
+       const string& libsMacro,
+       const string& pefixupParameters )
 {
        string target ( GetTargetMacro ( module ) );
        string target_folder ( GetDirectory ( GetTargetFilename ( module, NULL ) ) );
 {
        string target ( GetTargetMacro ( module ) );
        string target_folder ( GetDirectory ( GetTargetFilename ( module, NULL ) ) );
@@ -1451,8 +1452,9 @@ MingwModuleHandler::GenerateLinkerCommand (
                          GetLinkerMacro ().c_str () );
        
                fprintf ( fMakefile,
                          GetLinkerMacro ().c_str () );
        
                fprintf ( fMakefile,
-                         "\t$(Q)$(PEFIXUP_TARGET) %s -exports\n",
-                         target.c_str () );
+                         "\t$(Q)$(PEFIXUP_TARGET) %s -exports %s\n",
+                         target.c_str (),
+                         pefixupParameters.c_str() );
 
                fprintf ( fMakefile,
                          "\t-@${rm} %s 2>$(NUL)\n",
 
                fprintf ( fMakefile,
                          "\t-@${rm} %s 2>$(NUL)\n",
@@ -1468,6 +1470,14 @@ MingwModuleHandler::GenerateLinkerCommand (
                          objectsMacro.c_str (),
                          libsMacro.c_str (),
                          GetLinkerMacro ().c_str () );
                          objectsMacro.c_str (),
                          libsMacro.c_str (),
                          GetLinkerMacro ().c_str () );
+
+               if ( pefixupParameters.length() != 0 )
+               {
+                       fprintf ( fMakefile,
+                                 "\t$(Q)$(PEFIXUP_TARGET) %s -exports %s\n",
+                                 target.c_str (),
+                                 pefixupParameters.c_str() );
+               }
        }
 
        GenerateBuildMapCode ();
        }
 
        GenerateBuildMapCode ();
@@ -2166,7 +2176,8 @@ MingwKernelModuleHandler::GenerateKernelModuleTarget ()
                                        "${gcc}",
                                        linkerParameters,
                                        objectsMacro,
                                        "${gcc}",
                                        linkerParameters,
                                        objectsMacro,
-                                       libsMacro );
+                                       libsMacro,
+                                       "-sections" );
        }
        else
        {
        }
        else
        {
@@ -2252,7 +2263,8 @@ MingwKernelModeDLLModuleHandler::GenerateKernelModeDLLModuleTarget ()
                                        "${gcc}",
                                        linkerParameters,
                                        objectsMacro,
                                        "${gcc}",
                                        linkerParameters,
                                        objectsMacro,
-                                       libsMacro );
+                                       libsMacro,
+                                       "-sections" );
        }
        else
        {
        }
        else
        {
@@ -2299,7 +2311,8 @@ MingwKernelModeDriverModuleHandler::GenerateKernelModeDriverModuleTarget ()
                                        "${gcc}",
                                        linkerParameters,
                                        objectsMacro,
                                        "${gcc}",
                                        linkerParameters,
                                        objectsMacro,
-                                       libsMacro );
+                                       libsMacro,
+                                       "-sections" );
        }
        else
        {
        }
        else
        {
@@ -2345,7 +2358,8 @@ MingwNativeDLLModuleHandler::GenerateNativeDLLModuleTarget ()
                                        "${gcc}",
                                        linkerParameters,
                                        objectsMacro,
                                        "${gcc}",
                                        linkerParameters,
                                        objectsMacro,
-                                       libsMacro );
+                                       libsMacro,
+                                       "" );
        }
        else
        {
        }
        else
        {
@@ -2391,7 +2405,8 @@ MingwNativeCUIModuleHandler::GenerateNativeCUIModuleTarget ()
                                        "${gcc}",
                                        linkerParameters,
                                        objectsMacro,
                                        "${gcc}",
                                        linkerParameters,
                                        objectsMacro,
-                                       libsMacro );
+                                       libsMacro,
+                                       "" );
        }
        else
        {
        }
        else
        {
@@ -2443,7 +2458,8 @@ MingwWin32DLLModuleHandler::GenerateWin32DLLModuleTarget ()
                                        linker,
                                        linkerParameters,
                                        objectsMacro,
                                        linker,
                                        linkerParameters,
                                        objectsMacro,
-                                       libsMacro );
+                                       libsMacro,
+                                       "" );
        }
        else
        {
        }
        else
        {
@@ -2495,7 +2511,8 @@ MingwWin32CUIModuleHandler::GenerateWin32CUIModuleTarget ()
                                        linker,
                                        linkerParameters,
                                        objectsMacro,
                                        linker,
                                        linkerParameters,
                                        objectsMacro,
-                                       libsMacro );
+                                       libsMacro,
+                                       "" );
        }
        else
        {
        }
        else
        {
@@ -2547,7 +2564,8 @@ MingwWin32GUIModuleHandler::GenerateWin32GUIModuleTarget ()
                                        linker,
                                        linkerParameters,
                                        objectsMacro,
                                        linker,
                                        linkerParameters,
                                        objectsMacro,
-                                       libsMacro );
+                                       libsMacro,
+                                       "" );
        }
        else
        {
        }
        else
        {
@@ -3046,7 +3064,8 @@ MingwTestModuleHandler::GenerateTestModuleTarget ()
                                        linker,
                                        linkerParameters,
                                        objectsMacro,
                                        linker,
                                        linkerParameters,
                                        objectsMacro,
-                                       libsMacro );
+                                       libsMacro,
+                                       "" );
        }
        else
        {
        }
        else
        {
index 496ebaf..7cf40c5 100644 (file)
@@ -113,7 +113,8 @@ protected:
                                     const std::string& linker,
                                     const std::string& linkerParameters,
                                     const std::string& objectsMacro,
                                     const std::string& linker,
                                     const std::string& linkerParameters,
                                     const std::string& objectsMacro,
-                                    const std::string& libsMacro );
+                                    const std::string& libsMacro,
+                                    const std::string& pefixupParameters );
        void GeneratePhonyTarget() const;
        void GenerateRules ();
        void GenerateImportLibraryTargetIfNeeded ();
        void GeneratePhonyTarget() const;
        void GenerateRules ();
        void GenerateImportLibraryTargetIfNeeded ();