Fix the -sections option of PEFIXUP tool and adapt RBUILD to use it.
Modified: trunk/reactos/tools/pefixup.c
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h
_____
Modified: trunk/reactos/tools/pefixup.c
--- trunk/reactos/tools/pefixup.c 2005-08-02 16:13:02 UTC (rev
16973)
+++ trunk/reactos/tools/pefixup.c 2005-08-02 18:13:21 UTC (rev
16974)
@@ -332,9 +332,6 @@
i < nt_header->OptionalHeader.NumberOfRvaAndSizes;
i++, section_header++)
{
- if (section_header->VirtualAddress)
- break;
-
if (!strcmp(section_header->Name, ".text") ||
!strcmp(section_header->Name, ".data") ||
!strcmp(section_header->Name, ".idata") ||
_____
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
2005-08-02 16:13:02 UTC (rev 16973)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
2005-08-02 18:13:21 UTC (rev 16974)
@@ -1412,7 +1412,8 @@
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 ) ) );
@@ -1451,8 +1452,9 @@
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",
@@ -1468,6 +1470,14 @@
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 ();
@@ -2166,7 +2176,8 @@
"${gcc}",
linkerParameters,
objectsMacro,
- libsMacro );
+ libsMacro,
+ "-sections" );
}
else
{
@@ -2252,7 +2263,8 @@
"${gcc}",
linkerParameters,
objectsMacro,
- libsMacro );
+ libsMacro,
+ "-sections" );
}
else
{
@@ -2299,7 +2311,8 @@
"${gcc}",
linkerParameters,
objectsMacro,
- libsMacro );
+ libsMacro,
+ "-sections" );
}
else
{
@@ -2345,7 +2358,8 @@
"${gcc}",
linkerParameters,
objectsMacro,
- libsMacro );
+ libsMacro,
+ "" );
}
else
{
@@ -2391,7 +2405,8 @@
"${gcc}",
linkerParameters,
objectsMacro,
- libsMacro );
+ libsMacro,
+ "" );
}
else
{
@@ -2443,7 +2458,8 @@
linker,
linkerParameters,
objectsMacro,
- libsMacro );
+ libsMacro,
+ "" );
}
else
{
@@ -2495,7 +2511,8 @@
linker,
linkerParameters,
objectsMacro,
- libsMacro );
+ libsMacro,
+ "" );
}
else
{
@@ -2547,7 +2564,8 @@
linker,
linkerParameters,
objectsMacro,
- libsMacro );
+ libsMacro,
+ "" );
}
else
{
@@ -3046,7 +3064,8 @@
linker,
linkerParameters,
objectsMacro,
- libsMacro );
+ libsMacro,
+ "" );
}
else
{
_____
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h
2005-08-02 16:13:02 UTC (rev 16973)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h
2005-08-02 18:13:21 UTC (rev 16974)
@@ -113,7 +113,8 @@
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 ();