flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > Feature request: make 0's uninitialized in PE section |
Author |
|
revolution 21 May 2009, 17:01
Why would we need to do this?
|
|||
21 May 2009, 17:01 |
|
SFeLi 21 May 2009, 17:09
Yesterday I saw a source that defined a huge list of data via macros and file directives. Resulting EXE had about 600 (!) kb of trailing zeroes in the .flat section. Why not to make PE formatter think about this?
|
|||
21 May 2009, 17:09 |
|
LocoDelAssembly 21 May 2009, 17:11
Quote:
Sure about this? I remember that some of my MASM programs were not working correctly when placed on ".data?" section variables and assumed them to be zero at start on Win98. |
|||
21 May 2009, 17:11 |
|
revolution 21 May 2009, 17:15
There are times where putting zeros is needed. With post-processing of files data may be inserted after the .exe is generated.
For the above file, just change your code to correctly generate the uninitialised data. I don't think it is a good idea to make the assembler guess at what you wanted. What happens when the guess is wrong and you have to find a workaround to fix the assembler's "error". |
|||
21 May 2009, 17:15 |
|
SFeLi 21 May 2009, 17:24
LocoDelAssembly, I’m using 98, almost always try to dd ? everything that needs to be 0 and never encountered such problems…
revolution, do you know a way to store dword ? at addr? But ok, I was wrong. |
|||
21 May 2009, 17:24 |
|
LocoDelAssembly 21 May 2009, 17:40
Microsoft Portable Executable and Common Object File Format Specification - Revision 8.1 – February 15, 2008 wrote: VirtualSize: The total size of the section when loaded into memory. If this value is greater than SizeOfRawData, the section is zero-padded. This field is valid only for executable images and should be set to zero for object files. This don't back my experience very much... I suppose the specs haven't changed over the time about this so probably my memory is failing me. |
|||
21 May 2009, 17:40 |
|
revolution 21 May 2009, 18:01
SFeLi wrote: do you know a way to store dword ? at addr? Code: virtual ... ; do your 'file' and whatever other stuff ... MyDataSize = $-$$ end virtual rb MyDataSize |
|||
21 May 2009, 18:01 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.