[ros-kernel] System DLL image bases in debug builds

Mike Nordell tamlin at algonet.se
Wed May 5 05:36:24 CEST 2004


User32 and gdi32 gets relocated on every use in a debug build. Not good.

That they are even loaded running a console-mode program, depedning on only
kernel32.dll, from CUI mode is of course also somewhat suboptimal, but
that's another issue.

I was thinking of moving (at least) kernel32 down a bit in the address space
for a debug build, and also space user32 and gdi32 a bit wider. This would
however require changing TARGET_BASE conditionally in the makefiles, and me
and makefiles is like teaching a cow fly - good luck. :-)

I think it would be as easy as
!IF DBG (== 1?)
TARGET_BASE = current adjusted by n
!ELSE
...

but before I even try this I felt some discussion about the matter could be
in place. For one thing, I'm not sure the current way is really maintainable
in the long run. ROS is starting to get a rather large amount of system
DLLs, and the number is likely to increase over time. How to make it
maintainable for the future I'm not sure, that's another reson for this
post.

One idea could be to have a file "bases.txt" in the lib directory containing
the names and preferred base address of each image, included by each
makefile for these DLLs using something like (using user32 as an example)
  include ../bases.txt
  TARGET_BASE = TARGET_BASE_USER32

>From one POV it could provide a nice single place to get an overview of the
current memory space allocated for DDLs, and the change required to the
makefiles would be trivial - even if boring. On the other hand, it'd be
another file to maintain and another dependency.

Comments? Ideas?

/Mike



More information about the Ros-kernel mailing list