flat assembler
Message board for the users of flat assembler.
Index
> Main > warning LNK4078: multiple '.text' sections found |
Author |
|
revolution 01 Apr 2024, 23:40
The .code macro outputs "section '.text' ...". So, yes you will get two text sections. This is expected.
|
|||
01 Apr 2024, 23:40 |
|
CoolCmd 02 Apr 2024, 06:10
revolution, no, the key is "with different attributes".
|
|||
02 Apr 2024, 06:10 |
|
Tomasz Grysztar 02 Apr 2024, 10:34
The IMAGE_SCN_CNT_UNINITIALIZED_DATA attribute is set up automatically for sections that contain no initialized data. Here fasm 1 for some reason sets it for one, but not the other. I believe this works more consistently with fasmg's formatter (and therefore fasm2).
Also, fasmg's formatter is easier to modify if you'd prefer to alter this legacy behavior (search coffms.inc for occurrences of IMAGE_SCN_CNT_UNINITIALIZED_DATA). |
|||
02 Apr 2024, 10:34 |
|
revolution 03 Apr 2024, 01:51
CoolCmd wrote: revolution, no, the key is "with different attributes". To clarify the difference in section attributes, we can see the following Code: format ms coff section '.text' ; CONTENTS, READONLY section '.text' ; CONTENTS, READONLY db 0 section '.text' ; ALLOC, READONLY rb 1 section '.text' ; CONTENTS, READONLY db 0 rb 1 Code: Sections: Idx Name Size VMA LMA File off Algn 0 .text 00000000 00000000 00000000 000000b4 2**2 CONTENTS, READONLY 1 .text 00000001 00000000 00000000 000000b4 2**2 CONTENTS, READONLY 2 .text 00000001 00000000 00000000 00000000 2**2 ALLOC, READONLY 3 .text 00000002 00000000 00000000 000000b5 2**2 CONTENTS, READONLY For the empty section I think it is kind of moot as to whether the CONTENTS or ALLOC flag is used, it has no data to contribute anyway. And if you change it to use the other flag setting then it becomes incompatible with other sections that have initialised data. So no matter which you choose you will find an incompatibility. |
|||
03 Apr 2024, 01:51 |
|
Tomasz Grysztar 03 Apr 2024, 11:45
revolution: but there is an actual bug there (although not a very serious one, I would say). Both sections are empty, but only one is marked as uninitialized. A simpler source that demonstrates the issue:
Code: format ms coff section 'test' section 'test' virtual end virtual |
|||
03 Apr 2024, 11:45 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.