News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Quick way to Update to Masm(ml.exe) 9

Started by ecube, March 26, 2009, 04:01:46 PM

Previous topic - Next topic

drizz

Quote from: BlackVortex on March 29, 2009, 06:39:42 PM
QuoteMSLink : use /MERGE:.data=.rdata command
MSLink : use /FILEALIGN:512 command

I can't get those to work. They get (silently) ignored ? Using MS linkerĀ  9.00.21022.08 , will try others, too.

I compare the resulting executables and the only difference is the timestampĀ  :eek
I only meant /MERGE as an example, i wrote the commands by heart, should be
>/MERGE:.rdata=.data< or better >/MERGE:.rdata=.text<
and for the size squeezers:
/FILEALIGN:512 /MERGE:.rdata=.text /MERGE:.rsrc=.text  /MERGE:.data=.text /MERGE:.bss=.text /SECTION:.text,RWE

oh btw FILEALIGN is an undocumented switch but should works with all link versions. Check the resulting PE with LordPE.
The truth cannot be learned ... it can only be recognized.

BlackVortex

Just tested (properly this time) and drizz is correct as always.

Also, more on-topic, can someone please upload somewhere latest MS link.exe and link.exe.config ? I have Visual Studio 9.0 but my version is earlier, it reports 9.00.21022.08.

(or PM)


jj2007

Quote from: drizz on March 29, 2009, 09:14:01 PM
oh btw FILEALIGN is an undocumented switch but should works with all link versions. Check the resulting PE with LordPE.

The switch works but does not produce smaller executables because its default is already 512 bytes. Try putting /FILEALIGN:1024...
The other switches work partially but do not seem to be able to produce the same size as polink with default switches.
Testbed attached.
And, no, I don't want to start a link vs polink debate, but I am curious to know what is fact and what is fiction.

[attachment deleted by admin]

BlackVortex

I confirm jj's findings. Polink is more efficient. I just wish the windows loader would accept a file alignment of 256, or a switch to omit the DOS header and stub.  Just for kicks    :green2

drizz

I forgot something :) I have my link patched not to produce "Rich Signature"
I can also run latest ml without manifests and winsxs dependency but those are topics for some other forum :)
The truth cannot be learned ... it can only be recognized.