|
From: Kai R. <kai...@lu...> - 2000-12-05 11:39:40
|
Appaiah Kumaraswamy wrote: > > Using his linking method, the executable size reduces drastically. > > gcc -c -o test.o test.c > gcc -s -Wl,--stack,10000 -o app.exe -Wl,--base-file,app.b test.o > dlltool --dllname app.exe --base-file app.b --output-exp app.e > gcc -s -Wl,--stack,10000 -o app.exe -Wl,--base-file,app.b > test.o -Wl,app.e > dlltool --dllname app.exe --base-file app.b --output-exp app.e > gcc -s -Wl,--stack,10000 -o app.exe test.o -Wl,app.e > rm app.b > rm app.e This seems to be obligatory for creating any Win32s binaries with Mingw (an updated one with import libs and startups for Win32s) now... > results with an executable of only 3584 bytes. This method also applies for > larger code as well as C++ code. Actually, it adds relocation information to > the code and can also be used to create relocatable DLLs. Is there now some single-pass method with '-shared' etc. to create the relocations using 'gcc' (which then uses 'ld') only ? Putting this to ones own makefiles isn't hard, but building GNU stuff like Cygnus Insight for Win32s needs special Makefiles with the three-pass linking while producing the '.exe's... I have specific sources with patched 'Makefile.in' files for Win32s now, but having common sources for Win32/Win32s would be better. The size isn't so important... Anyhow using this method for the Win32 binaries too could be tried... I think I have tried, creating relocatable executables, but the executables being a little bigger, not smaller (when talking about those 1.5 Mbyte-sized Insights)... Cheers, Kai |