From: RomikB <ro...@ma...> - 2003-06-20 09:33:29
|
Hello mingw-users, I create a set of dll's. I use: gcc -O2 -shared -Wl,-s -o file.dll file.c But when i try load them, I get an error: not all dll's can be loaded. When I remove -Wl,-s switch a problem disapear, but dll's now it TOOO BIG. Please answer how can I reduse the size of dll. (I don't need debug or symbol info. Need only relocation info.) -- Best regards, RomikB mailto:ro...@ma... |
From: Luke D. <cod...@ho...> - 2003-06-20 10:03:00
|
First please see this page about what information you need to include when reporting a problem: http://www.mingw.org/bugs.shtml I can't reproduce this with a trivial example so you'll need to provide a small test case, and you can try comparing the DLLs yourself to find out what is changing with "-s", for example with this command: objdump -p file.dll Luke ----- Original Message ----- From: "RomikB" <ro...@ma...> To: <min...@li...> Sent: Friday, June 20, 2003 5:29 PM Subject: [Mingw-users] Dll Loading > Hello mingw-users, > > I create a set of dll's. > I use: > > gcc -O2 -shared -Wl,-s -o file.dll file.c > > But when i try load them, I get an error: not all dll's can be loaded. > > When I remove -Wl,-s switch a problem disapear, but dll's now it TOOO > BIG. > > Please answer how can I reduse the size of dll. > (I don't need debug or symbol info. Need only relocation info.) > > -- > Best regards, > RomikB mailto:ro...@ma... |
From: RomikB <ro...@ma...> - 2003-06-20 12:23:34
|
Hello Luke, Friday, June 20, 2003, 1:02:46 PM, you wrote: LD> First please see this page about what information you need to include when LD> reporting a problem: http://www.mingw.org/bugs.shtml LD> I can't reproduce this with a trivial example so you'll need to provide a LD> small test case, and you can try comparing the DLLs yourself to find out LD> what is changing with "-s", for example with this command: LD> objdump -p file.dll In gcc manual(linker options): -s Remove all symbol table and relocation information from the executable. In ld manual: -s, -strip-all Omit all symbol information from the output file. So when i using -s I lost relocation information, but .reloc section still exist, and dll's that have the same or crossing base addreses can't be loaded succesfuly. GCC 3.2.3 MinGW 2.0.0-3 GNU ld version 2.13.90 20030104 >> I create a set of dll's. >> I use: >> gcc -O2 -shared -Wl,-s -o file.dll file.c >> But when i try load them, I get an error: not all dll's can be loaded. >> When I remove -Wl,-s switch a problem disapear, but dll's now it TOOO >> BIG. >> Please answer how can I reduse the size of dll. >> (I don't need debug or symbol info. Need only relocation info.) -- Best regards, RomikB mailto:ro...@ma... |
From: <mi...@ca...> - 2003-06-20 10:33:37
|
Have you tried strip file.dll ? ----- Original Message ----- From: "RomikB" <ro...@ma...> To: <min...@li...> Sent: Friday, June 20, 2003 11:29 AM Subject: [Mingw-users] Dll Loading > Hello mingw-users, > > I create a set of dll's. > I use: > > gcc -O2 -shared -Wl,-s -o file.dll file.c > > But when i try load them, I get an error: not all dll's can be loaded. > > When I remove -Wl,-s switch a problem disapear, but dll's now it TOOO > BIG. > > Please answer how can I reduse the size of dll. > (I don't need debug or symbol info. Need only relocation info.) > > -- > Best regards, > RomikB mailto:ro...@ma... > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > |
From: Stephen C. <ste...@di...> - 2003-06-20 18:31:36
|
try 'strip --strip-unneeded blah.dll' --Stephen |
From: Al S. <al....@sc...> - 2003-06-20 14:11:07
|
Hi, I am having a problem with templated code being exported from a dll. This is an example as the real code is too complex to produce here :) Header.h class myclass { }; template <class T> class tclass { static T record; } /*****/ Instant.cpp #include "Header.h" myclass tclass<myclass>::record; // instantiate the static record /* more myclass stuff */ /********/ The above is compiled into a dll using g++ -shared -export-all When a program is compiled against the above dll (linking directly to the dll) the program Appears to get its own copy of myclass tclass<myclass>::record wich appears to override the one in the dll. Does this ring any bells with anyone? I'll try to come up with a real test case in the meantime. Regards Al Slater Senior Developer Stanton Consultancy |
From: Christopher S. <x...@xm...> - 2003-06-20 16:12:58
|
On Fri, 2003-06-20 at 07:13, Al Slater wrote: > When a program is compiled against the above dll (linking directly to > the dll) the program Appears to get its own copy of myclass > tclass<myclass>::record wich appears to override the one in the dll. > > > Does this ring any bells with anyone? Yup, we were just talking about this on my C++ user's group list. You of course have two separate compilation units here, so each of them has a copy of that static variable. Classic example of the misnomer people tend to have about what the scope of their singleton's are. ;-) --Chris |
From: <mi...@ca...> - 2003-06-20 16:25:07
|
Dont remove relocation symbols from a DLL, then you cant be sure that you can load it. (If address mappings collide). (But... if you know for certain which process that will load it and that no collisions will occur, it can be ok to remove the relocs of course). I think that relocs always can be removed from exe:s, but I am not certain how it is under win98, maybe someone knows? /Anders Lindén ----- Original Message ----- From: "RomikB" <ro...@ma...> To: <min...@li...> Sent: Friday, June 20, 2003 2:21 PM Subject: Re[2]: [Mingw-users] Dll Loading > Hello Luke, > > Friday, June 20, 2003, 1:02:46 PM, you wrote: > > LD> First please see this page about what information you need to include when > LD> reporting a problem: http://www.mingw.org/bugs.shtml > LD> I can't reproduce this with a trivial example so you'll need to provide a > LD> small test case, and you can try comparing the DLLs yourself to find out > LD> what is changing with "-s", for example with this command: > LD> objdump -p file.dll > > In gcc manual(linker options): > -s > Remove all symbol table and relocation information from the executable. > > In ld manual: > -s, -strip-all > Omit all symbol information from the output file. > > So when i using -s I lost relocation information, but .reloc section > still exist, and dll's that have the same or crossing base addreses > can't be loaded succesfuly. > > GCC 3.2.3 > MinGW 2.0.0-3 > GNU ld version 2.13.90 20030104 > > >> I create a set of dll's. > >> I use: > >> gcc -O2 -shared -Wl,-s -o file.dll file.c > >> But when i try load them, I get an error: not all dll's can be loaded. > >> When I remove -Wl,-s switch a problem disapear, but dll's now it TOOO > >> BIG. > >> Please answer how can I reduse the size of dll. > >> (I don't need debug or symbol info. Need only relocation info.) > > -- > Best regards, > RomikB mailto:ro...@ma... > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users |
From: Benjamin R. <Ben...@ep...> - 2003-06-20 17:13:11
|
Hi Anders, Anders Lind=E9n <mi...@ca...> writes: > I think that relocs always can be removed from exe:s, but I am not > certain how it is under win98, maybe someone knows? Win98 would be ok. Wine used to load apps at some other than the canonical address, but I don't know if it still does that. benny |