flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > fasm is always setting initialized data flag in MS COFF?

Author
Thread Post new topic Reply to topic
SFeLi



Joined: 03 Nov 2004
Posts: 140
Location: Severodvinsk, Russia
SFeLi
Hello. I cannot link to an object file produced from the following code:
Code:
format ms coff
section '.bss' data readable writeable
public buffer as '_buffer'
buffer rb 32768
    

Microsoft linker says:
Code:
foo.obj
foo.obj : fatal error LNK1107: invalid or corrupt file: cannot read at 0x8000
    

dumpbin says:
Code:
SECTION HEADER #1
    .bss name
       0 physical address
       0 virtual address
    8000 size of raw data
       0 file pointer to raw data
       0 file pointer to relocation table
       0 file pointer to line numbers
       0 number of relocations
       0 number of line numbers
C03000C0 flags
         Initialized Data <--
         Uninitialized Data
         4 byte align
         Read Write
    


It links without errors when I remove IMAGE_SCN_CNT_INITIALIZED_DATA from section flags.
Post 15 May 2015, 20:23
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7532
Location: Kraków, Poland
Tomasz Grysztar
The DATA keyword in the section definition translates directly to IMAGE_SCN_CNT_INITIALIZED_DATA flag. To get rid of the flag, remove the DATA keyword.
Post 15 May 2015, 20:34
View user's profile Send private message Visit poster's website Reply with quote
SFeLi



Joined: 03 Nov 2004
Posts: 140
Location: Severodvinsk, Russia
SFeLi
Tomasz Grysztar, thank you.
Post 15 May 2015, 20:37
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.