If you really must use align, use /FILEALIGN and not /ALIGN . And before making statements about which OSes support these files and which don't, perhaps you should check your facts.
Posted on 2003-05-12 02:34:35 by f0dder
At the end of his PE tutorial, Luevelsmeyer writes:

Alas, this works on NT but didn't on windows 95. windows95 can't run
applications with a section alignment of 32 bytes, it needs an
alignment of 4 KB and, apparently, a file alignment of 512 bytes. So for
windows95 you'll have to insert a large number of 0-bytes (for padding)
and adjust the RVAs. Thanks go to D. Binette for testing on windows95.


In his article on http://msdn.microsoft.com/msdnmag/issues/02/02/PE/default.aspx Matt Pietrek writes:

An interesting linker feature is the ability to merge sections. If two sections have similar, compatible attributes, they can usually be combined into a single section at link time. This is done via the linker /merge switch. For instance, the following linker option combines the .rdata and .text sections into a single section called .text:
/MERGE:.rdata=.text


All things I've written was grabbed from the web!

However I think you have reason when you say If you really must use align, use /FILEALIGN and not /ALIGN
Posted on 2003-05-12 06:28:01 by Benji
LuevelMeyers stuff is old. NT4/win95. Do some tests on other NT and 9x flavours, you'll see.

Merging works (though you should do careful testing if you merge resources). Also, if you merge code and data, your code section loses the nice read-only property.


All things I've written was grabbed from the web!

As if that guaranteed it's correctness ;)

And yes, there's good reason for using /filealign instead of /align . Like, /align will cause relocation trouble with values < 4096.
Posted on 2003-05-12 07:27:53 by f0dder
thank you!
btw, can you say me where can I find a good and recent :grin: PE tutorial? unfortunately all tutes I have are obsolete :-(

PS: I thought (I hoped) that Luevelsmeyer and Pietrek were reliable :-) I will have to test all the programs on more operating systems :-S
Posted on 2003-05-12 10:01:03 by Benji
I think We should first try to made a DOS exe first. It only 32-Byte Header, more easy to remember. I can build a COM file bare handed, and it working properly. But My exe generate exception on my windows "Invalid Win32 blah2x..." ( Honestly, the invalid message is "Idiot Win32 Coder" :Grin: I heard Hutch did the same thing too 5 Years ago :Grin:).
Posted on 2003-05-12 22:13:01 by realvampire