flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > [BUG] Some docs and formatter bug's with MZ and PE |
Author |
|
SFeLi 30 Nov 2009, 06:31
Are you sure about section '.reloc' data readable discardable fixups? AFAIK, Windows loader sets protection attributes after fixup stage. Am I wrong?
|
|||
30 Nov 2009, 06:31 |
|
DOS386 30 Nov 2009, 06:46
It apparently works (in most version of Windows) without "readable" ... but still seems to be a BUG.
|
|||
30 Nov 2009, 06:46 |
|
Tomasz Grysztar 01 Dec 2009, 13:34
DOS386 wrote:
The MZ executable can have larger size in memory than in file, if you put undefined data at the end of source, the header will tell DOS to allocate more memory than just what is needed to load the pages from file. Also, if you don't define stack yourself, fasm defines stack automatically, using the same mechanism to ensure that required memory is allocated. DOS386 wrote:
Right, it's a bit unfortunate phrase. I'd go for "Default value of this setting is 65535" instead. Or even just insert word "maximum" before the "size". DOS386 wrote: Problem: When placing multiple aforementioned things into one section, FASM is happy and brews the PE, but it is garbage and doesn't run. There is a lot of methods how to make executable that's will not work properly by abusing various settings. However you can still (if you're clever enough) utilize them in such a way, that even with combined (supposedly contradictory) settings you may get something correct. fasm should not limit your options unless it's something impossible to implement according to format limitations. But this is not the case. DOS386 wrote:
This is questionable - the "readable" flag applies to the run-time settings of the section, that is it refers to the ability of your own code to read this section. However it should not affect the loader, which has to be able to read all the sections anyway. Personally, I think that combining "readable" with "discardable" is not a very useful combination, since the section that can be discarded is not safe for you to read anyway, so if you wanted to be able to read it from your code, you shouldn't put "discardable" there in the first place. |
|||
01 Dec 2009, 13:34 |
|
DOS386 01 Dec 2009, 14:03
Tomasz Grysztar wrote: The MZ executable can have larger size in memory than in file, if you put undefined data at the end of source, the header will tell DOS to allocate more memory than just what is needed to load the pages from file. So "undefined data" is the difference between size promised in the header and actual file size ??? Quote: There is a lot of methods how to make executable that's will not work properly by abusing various settings. However you can still (if you're clever enough) utilize them in such a way, that even with combined (supposedly contradictory) settings you may get something correct. fasm should not limit your options unless it's something impossible to implement according to format limitations. But this is not the case. I can put all into one section when using format binary as "DLL" Quote: This is questionable - the "readable" flag applies to the run-time settings of the section, that is it refers to the ability of your own code to read this section. However it should not affect the loader, which has to be able to read all the sections anyway. Personally, I think that combining "readable" with "discardable" is not a very useful combination, since the section that can be discarded is not safe for you to read anyway, so if you wanted to be able to read it from your code, you shouldn't put "discardable" there in the first place. OK, interesting point. Then all linkers are faulty |
|||
01 Dec 2009, 14:03 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.