From: Alex Blekhman on 21 Aug 2008 10:48 "Vincent Fatica" wrote: > When I provide my own memset() I get > > Size: 14848 .text 1B74 .rdata EFC .data 41CC .rsrc 270 .reloc > 4FA > > When I don't, and let the compiler warn me, I get > > Size: 18944 .text 2466 .rdata 104C .data 451C .CRT 8 .rsrc 270 > .reloc 5B8 > > That's an extra section, 2290 bytes of text, 336 bytes of rdata, > and 848 bytes of data. My own memset() (copied from the CRT > sources) seems to need only 96 bytes. What do you suppose all > that extra code and data is doing? Frankly, I have no idea. In my test proejct if I don't provide an implementation of `memset' I get linker errors, not warnings. Moreover, I don't have .CRT section even if I use CRT. I check resulting DLL with DUMPBIN utility. What do you have in the .CRT section? Alex
From: Vincent Fatica on 21 Aug 2008 11:06 On Thu, 21 Aug 2008 17:48:33 +0300, "Alex Blekhman" <tkfx.REMOVE(a)yahoo.com> wrote: >"Vincent Fatica" wrote: >> When I provide my own memset() I get >> >> Size: 14848 .text 1B74 .rdata EFC .data 41CC .rsrc 270 .reloc >> 4FA >> >> When I don't, and let the compiler warn me, I get >> >> Size: 18944 .text 2466 .rdata 104C .data 451C .CRT 8 .rsrc 270 >> .reloc 5B8 >> >> That's an extra section, 2290 bytes of text, 336 bytes of rdata, >> and 848 bytes of data. My own memset() (copied from the CRT >> sources) seems to need only 96 bytes. What do you suppose all >> that extra code and data is doing? > >Frankly, I have no idea. In my test proejct if I don't provide an >implementation of `memset' I get linker errors, not warnings. >Moreover, I don't have .CRT section even if I use CRT. I check >resulting DLL with DUMPBIN utility. What do you have in the .CRT >section? Use a custom entry point and don't explicitly call any CRT stuff. Don't use /NODDEFAILTLIB and it'll build with warnings and the .CRT section. My .CRT section contains B02C0010742D0010 but as I said, if I hex edit that to 0000000000000000, it seems to make no difference. -- - Vince
From: Vincent Fatica on 21 Aug 2008 11:48 I tried to make a small example of this with VC8 and failed. Then I build my example with VC7, copied the project dir to my VC8 installation and let VC8 convert the project. Apparently something in the conversion causes the warnings and the .CRT section. The code below compiled fine in a newly created VC8 project. But when converted from a VC7 project gave: LIBCMT.lib(mathfcns.obj) : warning LNK4210: .CRT section exists; there may be unhandled static initializers or terminators LIBCMT.lib(cpu_disp.obj) : warning LNK4210: .CRT section exists; there may be unhandled static initializers or terminators Here's the code: #include <windows.h> INT mymain ( VOID ) { WCHAR szText[32] = L"foo"; DWORD dwWritten; WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), szText, lstrlen(szText), &dwWritten, NULL); return 0; } -- - Vince
From: Alex Blekhman on 21 Aug 2008 11:51 "Vincent Fatica" wrote: > Use a custom entry point and don't explicitly call any CRT > stuff. > > Don't use /NODDEFAILTLIB and it'll build with warnings and the > .CRT section. Did you migrate from the earlier version of VS? Because if I create new DLL project from scratch with VC++ and then run DUMPBIN with resulting DLL, then there is no .CRT section. I tested it both with VC++2005 and VC++2008. Alex
From: Vincent Fatica on 21 Aug 2008 15:42 On Thu, 21 Aug 2008 18:51:03 +0300, "Alex Blekhman" <tkfx.REMOVE(a)yahoo.com> wrote: >"Vincent Fatica" wrote: >> Use a custom entry point and don't explicitly call any CRT >> stuff. >> >> Don't use /NODDEFAILTLIB and it'll build with warnings and the >> .CRT section. > >Did you migrate from the earlier version of VS? Because if I >create new DLL project from scratch with VC++ and then run DUMPBIN >with resulting DLL, then there is no .CRT section. I tested it >both with VC++2005 and VC++2008. Yes, see my other recent post. I let VC8 convert a VC7 project. That introduces the problem. But I can't find what the conversion changed. -- - Vince
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: Mixed code - Crashes in Release Mode Next: Printing from Console Application |