Hi,

while porting kde2 the rebase tool solved some problems for me on using libtools 
libltdl.

In the past I have to use the LTDL_DLOPEN_DEPLIBS in the config.h of libtldl, which 
enables
loading of all dependency dll's of a lib and because of many dll's used for kde this 
slow
down application loading significantly. If I haven't used this flag, cygwin tells 
about a
"... can't remap ..." problem.
After rebasing the dll's from the kdelibs, this error does not happens anymore and I 
can
reject this config option.

libltdl/config.h
...
/* Define if the OS needs help to load dependent libraries for dlopen(). */
//#define LTDL_DLOPEN_DEPLIBS 1
....

On analysing this problem I added an option "-l" to the rebase tool to list dll's 
imagebase
and -size without rebasing. It's very interesting to see how MS chooses there 
Imagebase.

Because I hacked this very quick, I have used simple FILE structure and fopen/fread 
calls.
Perhaps someone like to change this to iostream functionality.

$ rebase -h
rebase: unknown option -- h
usage: rebase -b BaseAddress [-d] -o Offset <file> ...  rebase <file>
usage: rebase -l <file> ...        list Imagebase and -size of <file>

Example:
$ rebase -l /opt/kde2/bin/*.dll
c:\programme\cygwin\opt\kde2\bin\cygDCOP-1.dll               - ImageBase: 74fb0000 
ImageSize:
00026000
c:\programme\cygwin\opt\kde2\bin\cygartsc-0.dll              - ImageBase: 74f80000 
ImageSize:
00007000
c:\programme\cygwin\opt\kde2\bin\cygartsflow-0.dll           - ImageBase: 74ee0000 
ImageSize:
0007a000
c:\programme\cygwin\opt\kde2\bin\cygartsflow_idl-0.dll       - ImageBase: 74e50000 
ImageSize:
0006f000
c:\programme\cygwin\opt\kde2\bin\cygartskde.dll              - ImageBase: 74df0000 
ImageSize:
0003f000
c:\programme\cygwin\opt\kde2\bin\cygkICE-0.dll               - ImageBase: 74db0000 
ImageSize:
00017000
c:\programme\cygwin\opt\kde2\bin\cygkab-3.dll                - ImageBase: 74d30000 
ImageSize:
0005e000
c:\programme\cygwin\opt\kde2\bin\cygkbuildsycoca.dll         - ImageBase: 74cf0000 
ImageSize:
0001d000
c:\programme\cygwin\opt\kde2\bin\cygkdecore-3.dll            - ImageBase: 74b30000 
ImageSize:
00194000
c:\programme\cygwin\opt\kde2\bin\cygkdefakes-3.dll           - ImageBase: 74b00000 
ImageSize:
00007000
c:\programme\cygwin\opt\kde2\bin\cygkdeprint-0.dll           - ImageBase: 74a50000 
ImageSize:
00084000
c:\programme\cygwin\opt\kde2\bin\cygkdeprint_management-0.dll - ImageBase: 749b0000
ImageSize: 00075000
c:\programme\cygwin\opt\kde2\bin\cygkdesu-1.dll              - ImageBase: 74960000 
ImageSize:
0002d000
c:\programme\cygwin\opt\kde2\bin\cygkdeui-3.dll              - ImageBase: 74750000 
ImageSize:
001ee000
c:\programme\cygwin\opt\kde2\bin\cygkfile-3.dll              - ImageBase: 74690000 
ImageSize:
0009c000
c:\programme\cygwin\opt\kde2\bin\cygkio-3.dll                - ImageBase: 74590000 
ImageSize:
000d2000
c:\programme\cygwin\opt\kde2\bin\cygkjava-1.dll              - ImageBase: 74540000 
ImageSize:
00027000
c:\programme\cygwin\opt\kde2\bin\cygkjs-1.dll                - ImageBase: 744d0000 
ImageSize:
00044000
c:\programme\cygwin\opt\kde2\bin\cygkmedia2-0.dll            - ImageBase: 74480000 
ImageSize:
00025000
c:\programme\cygwin\opt\kde2\bin\cygkmedia2_idl-0.dll        - ImageBase: 74400000 
ImageSize:
00054000
c:\programme\cygwin\opt\kde2\bin\cygkmid-0.dll               - ImageBase: 743c0000 
ImageSize:
0001b000
c:\programme\cygwin\opt\kde2\bin\cygkonq-3.dll               - ImageBase: 74300000 
ImageSize:
0009c000
c:\programme\cygwin\opt\kde2\bin\cygkonqsidebartree_bookmarks-0.dll - ImageBase: 
742d0000
ImageSize: 0000e000
c:\programme\cygwin\opt\kde2\bin\cygkparts-1.dll             - ImageBase: 74270000 
ImageSize:
00033000
c:\programme\cygwin\opt\kde2\bin\cygkspell-3.dll             - ImageBase: 74220000 
ImageSize:
00029000
c:\programme\cygwin\opt\kde2\bin\cygkssl-2.dll               - ImageBase: 741d0000 
ImageSize:
0002e000
c:\programme\cygwin\opt\kde2\bin\cygksycoca-3.dll            - ImageBase: 740f0000 
ImageSize:
000b9000
c:\programme\cygwin\opt\kde2\bin\cygktexteditor-0.dll        - ImageBase: 740c0000 
ImageSize:
0000f000
c:\programme\cygwin\opt\kde2\bin\cygltdl-0.dll               - ImageBase: 74090000 
ImageSize:
0000a000
c:\programme\cygwin\opt\kde2\bin\cygmcop-0.dll               - ImageBase: 73f60000 
ImageSize:
00101000
c:\programme\cygwin\opt\kde2\bin\cygmcop_mt-0.dll            - ImageBase: 73f30000 
ImageSize:
00007000
c:\programme\cygwin\opt\kde2\bin\cygqtmcop-0.dll             - ImageBase: 73ef0000 
ImageSize:
0001f000
c:\programme\cygwin\opt\kde2\bin\cygsoundserver_idl-0.dll    - ImageBase: 73e70000 
ImageSize:
0005a000
c:\programme\cygwin\opt\kde2\bin\cygxml2-2.dll               - ImageBase: 73dc0000 
ImageSize:
00085000
c:\programme\cygwin\opt\kde2\bin\cygxslt-0.dll               - ImageBase: 73d70000 
ImageSize:
00021000


Regards
Ralf


Attachment: rebase-list-option.dif
Description: Binary data

Attachment: rebase.cc
Description: Binary data

Attachment: Makefile
Description: Binary data

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply via email to