flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > MSCOFF and section directive |
Author |
|
Tomasz Grysztar 18 Jul 2009, 13:26
The value 0xC03000C0 consists of the following flags (check out the PE/COFF format specification):
As you can see, all the flags that are generated can be controlled from the source. |
|||
18 Jul 2009, 13:26 |
|
Nikolay Petrov 18 Jul 2009, 14:01
Perfect! So what should follow code after 'section ".data" ' to contain only the following flags:
IMAGE_SCN_MEM_WRITE + IMAGE_SCN_MEM_READ + IMAGE_SCN_CNT_INITIALIZED_DATA I guess that solve me the problem of two '.data' sections in final executable program. _________________ regards |
|||
18 Jul 2009, 14:01 |
|
bitRAKE 19 Jul 2009, 00:19
Code: section ".data" data readable writeable Does the section name ".data$0" prevent the warning? The linker merges sections automatically based on the "name$order". If there is no default alignment then sections merge as expected. Whereas the alignment can create a gap between parts of the same section. Ideally, only one section would specify section alignment while others are merged bytewise. How to support this without breaking the ALIGN directive? Doesn't seem possible. |
|||
19 Jul 2009, 00:19 |
|
Tomasz Grysztar 19 Jul 2009, 09:52
bitRAKE wrote: Ideally, only one section would specify section alignment while others are merged bytewise. Ideally every fragment of data you create should be aligned appropriately for the given data size. Those "gaps" you're talking about are there for a reason. Anyway, to get rid of the default alignment, just use "align 1" command in the section directive. |
|||
19 Jul 2009, 09:52 |
|
Nikolay Petrov 19 Jul 2009, 11:06
For more clarity on the issue I send a simple example.
p.s. versions of the microsoft compilers: Microsoft (R) Macro Assembler Version 7.10.4035 Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.4035 for 80x86 - Window DDK package
_________________ regards |
|||||||||||
19 Jul 2009, 11:06 |
|
Tomasz Grysztar 19 Jul 2009, 11:33
So either use a right kind of section for uninitialized data (.bss), or put some initialized data into the .data section to stop fasm from generating the uninitialized data flag.
|
|||
19 Jul 2009, 11:33 |
|
Nikolay Petrov 19 Jul 2009, 13:35
Flat assembler has many advantages over Microsoft assembler. That's why is preferred by me in the case of mixing 'c' and 'asm' code.
In my practice I solve the 'problem' by defining the variables in 'c' file, merge the sections with diffrent names(is not very correct) and in other ways depending on the specifically, but Quote: So either use a right kind of section for uninitialized data (.bss) Thanks. |
|||
19 Jul 2009, 13:35 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.