[ros-diffs] [ros-arm-bringup] 34444: - Do NOT prepend _ to ARM entrypoints. - Because of some ridiculously stupid design in LD, it seems if it cannot find a given entrypoint, it SILENTLY ASSUMES you meant "Hi LD, please use my base address as my entrypoint". - As such, all our drivers were linked with the start address as the base address... for the RAMDisk driver, this ended up being RamdiskAddDevice. - When we started implementing RamdiskAddDevice, noticed that DriverEntry wasn't actually getting called. Adding debug prints changed which function was called. - Wasted a week, thanks LD.

ros-arm-bringup at svn.reactos.org ros-arm-bringup at svn.reactos.org
Sun Jul 13 03:56:20 CEST 2008


Author: ros-arm-bringup
Date: Sat Jul 12 20:56:20 2008
New Revision: 34444

URL: http://svn.reactos.org/svn/reactos?rev=34444&view=rev
Log:
- Do NOT prepend _ to ARM entrypoints.
- Because of some ridiculously stupid design in LD, it seems if it cannot find a given entrypoint, it SILENTLY ASSUMES you meant "Hi LD, please use my base address as my entrypoint".
- As such, all our drivers were linked with the start address as the base address... for the RAMDisk driver, this ended up being RamdiskAddDevice.
- When we started implementing RamdiskAddDevice, noticed that DriverEntry wasn't actually getting called. Adding debug prints changed which function was called.
- Wasted a week, thanks LD.


Modified:
    trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp

Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp?rev=34444&r1=34443&r2=34444&view=diff
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] Sat Jul 12 20:56:20 2008
@@ -2641,7 +2641,7 @@
 		string dependencies = linkDepsMacro + " " + objectsMacro;
 
 		string linkerParameters = ssprintf ( "-subsystem=native -entry=%s -image-base=%s -file-alignment=0x1000 -section-alignment=0x1000 -shared",
-		                                     module.GetEntryPoint(true).c_str (),
+		                                     module.GetEntryPoint(!(Environment::GetArch() == "arm")).c_str (),
 		                                     module.baseaddress.c_str () );
 		GenerateLinkerCommand ( dependencies,
 		                        linkerParameters,
@@ -2690,7 +2690,7 @@
 		string dependencies = linkDepsMacro + " " + objectsMacro;
 
 		string linkerParameters = ssprintf ( "-subsystem=native -entry=%s -image-base=%s -file-alignment=0x1000 -section-alignment=0x1000 -shared",
-		                                     module.GetEntryPoint(true).c_str (),
+		                                     module.GetEntryPoint(!(Environment::GetArch() == "arm")).c_str (),
 		                                     module.baseaddress.c_str () );
 		GenerateLinkerCommand ( dependencies,
 		                        linkerParameters,
@@ -2738,7 +2738,7 @@
 		string dependencies = linkDepsMacro + " " + objectsMacro;
 
 		string linkerParameters = ssprintf ( "-subsystem=native -entry=%s -image-base=%s -file-alignment=0x1000 -section-alignment=0x1000 -shared",
-		                                     module.GetEntryPoint(true).c_str (),
+		                                     module.GetEntryPoint(!(Environment::GetArch() == "arm")).c_str (),
 		                                     module.baseaddress.c_str () );
 		GenerateLinkerCommand ( dependencies,
 		                        linkerParameters,
@@ -2786,7 +2786,7 @@
 		string dependencies = linkDepsMacro + " " + objectsMacro;
 
 		string linkerParameters = ssprintf ( "-subsystem=native -entry=%s -image-base=%s -file-alignment=0x1000 -section-alignment=0x1000",
-		                                     module.GetEntryPoint(true).c_str (),
+		                                     module.GetEntryPoint(!(Environment::GetArch() == "arm")).c_str (),
 		                                     module.baseaddress.c_str () );
 		GenerateLinkerCommand ( dependencies,
 		                        linkerParameters,
@@ -2911,7 +2911,7 @@
 		string dependencies = linkDepsMacro + " " + objectsMacro;
 
 		string linkerParameters = ssprintf ( "-subsystem=console -entry=%s -image-base=%s -file-alignment=0x1000 -section-alignment=0x1000 -shared",
-		                                     module.GetEntryPoint(true).c_str (),
+		                                     module.GetEntryPoint(!(Environment::GetArch() == "arm")).c_str (),
 		                                     module.baseaddress.c_str () );
 		GenerateLinkerCommand ( dependencies,
 		                        linkerParameters,
@@ -2953,7 +2953,7 @@
 		string dependencies = linkDepsMacro + " " + objectsMacro;
 
 		string linkerParameters = ssprintf ( "-subsystem=console -entry=%s -image-base=%s -file-alignment=0x1000 -section-alignment=0x1000 -shared",
-		                                     module.GetEntryPoint(true).c_str (),
+		                                     module.GetEntryPoint(!(Environment::GetArch() == "arm")).c_str (),
 		                                     module.baseaddress.c_str () );
 		GenerateLinkerCommand ( dependencies,
 		                        linkerParameters,
@@ -3002,7 +3002,7 @@
 		string dependencies = linkDepsMacro + " " + objectsMacro;
 
 		string linkerParameters = ssprintf ( "-subsystem=console -entry=%s -image-base=%s -file-alignment=0x1000 -section-alignment=0x1000",
-		                                     module.GetEntryPoint(true).c_str (),
+		                                     module.GetEntryPoint(!(Environment::GetArch() == "arm")).c_str (),
 		                                     module.baseaddress.c_str () );
 		GenerateLinkerCommand ( dependencies,
 		                        linkerParameters,
@@ -3051,7 +3051,7 @@
 		string dependencies = linkDepsMacro + " " + objectsMacro;
 
 		string linkerParameters = ssprintf ( "-subsystem=windows -entry=%s -image-base=%s -file-alignment=0x1000 -section-alignment=0x1000",
-		                                     module.GetEntryPoint(true).c_str (),
+		                                     module.GetEntryPoint(!(Environment::GetArch() == "arm")).c_str (),
 		                                     module.baseaddress.c_str () );
 		GenerateLinkerCommand ( dependencies,
 		                        linkerParameters,
@@ -3673,7 +3673,7 @@
 		string dependencies = linkDepsMacro + " " + objectsMacro;
 
 		string linkerParameters = ssprintf ( "-subsystem=console -entry=%s -image-base=%s -file-alignment=0x1000 -section-alignment=0x1000",
-		                                     module.GetEntryPoint(true).c_str (),
+		                                     module.GetEntryPoint(!(Environment::GetArch() == "arm")).c_str (),
 		                                     module.baseaddress.c_str () );
 		GenerateLinkerCommand ( dependencies,
 		                        linkerParameters,



More information about the Ros-diffs mailing list