Hi Poimander,

thanks for the info. I will try to find the cygwin version.

> the alternative -q option isn't implemented in the MinGW version

BTW, it *is* implemented in the MinGW version --- in the way that LD doesn't complain.. But the docs say:

-q
--emit-relocs
Leave relocation sections and contents in fully linked exececutables. Post link analysis and optimization tools may need this information in order to perform correct modifications of executables. This results in larger executables.
This option is currently only supported on ELF platforms.


So this switch has no effect for win32 binaries, I verified it.

Regards

Japheth
Posted on 2004-10-11 02:41:54 by japheth
Here is another example of using the GNU linker ld.exe with Masm, the -s switch allows to produce small executables

\masm32\bin\ml /c /coff Dialog.asm
\goasm\gorc /o Rsrc.rc
ld -e_start -subsystem windows -Lc:\masm32\lib -o Dialog.exe Dialog.obj Rsrc.obj -luser32 -lkernel32 -s
Attachments:
Posted on 2005-12-08 12:50:27 by Vortex
thanks vortex, but perhaps you should mention which version of LD you are using and where to get it. At least the version I tried (from binutils-2.16.91, date 8/27/2005) doesn't understand some of the cmdline options of your sample.
Posted on 2005-12-09 01:32:00 by japheth
Hi japheth,

Yes, you are right. My apologies, I should mention about the version of ld.exe

I am using ld.exe coming with the MinGW Developer Studio 2.05 package (build 04-01-2005)

http://parinyasoft.com/

The linker comes with the full package :

http://parinyasoft.com/download/MinGWStudioFullSetup-2.05.exe

The linker ld.exe supplied with the package dates 01.20.2005

The critical switch to build a small executable is -s :
-s 
--strip-all
Omit all symbol information from the output file.
Posted on 2005-12-09 12:39:42 by Vortex