flat assembler
Message board for the users of flat assembler.

Index > Windows > ..

Author
Thread Post new topic Reply to topic
pool



Joined: 08 Jan 2007
Posts: 97
Location: Philippines
pool
..


Last edited by pool on 17 Mar 2013, 12:02; edited 1 time in total
Post 09 Dec 2008, 10:30
View user's profile Send private message Visit poster's website Reply with quote
asmcoder



Joined: 02 Jun 2008
Posts: 784
asmcoder
[content deleted]


Last edited by asmcoder on 14 Aug 2009, 14:54; edited 1 time in total
Post 09 Dec 2008, 11:58
View user's profile Send private message Reply with quote
calpol2004



Joined: 16 Dec 2004
Posts: 110
calpol2004
i always though it to be the same as .data but none of your data actually get stored it gets reserved instead. I always used it to declare variables which i would then give a value later.

It can reduce your application size by a small amount. i imagine that all the bytes that you declared get counted into one number and the exe loader simply allocates that much memory at loadtime and doesnt actually load the values you'd specified. since only the size of the of the section is needed to build the section then it saves space.

I don't really know what im talking about tbh, but the way i see it seems to work.
Post 09 Dec 2008, 17:54
View user's profile Send private message MSN Messenger Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
pool,

Section names are irrelevant in executable, they're used by linker to combine sections with the same [base] name from different object files (in COFF e.g.)

Usually ".bss" section contains only uninitialized data (as in EXAMPLES\DDRAW.ASM you'd mentioned). fasm or linker omits uninitialized trailing bytes from raw section data in resulting executable, thus making it smaller on disk.
asmcoder wrote:
bss is usually wrong implementation of VirtualSize in COFF.
What did you meant, wrong implementation?
Post 09 Dec 2008, 18:41
View user's profile Send private message Reply with quote
asmcoder



Joined: 02 Jun 2008
Posts: 784
asmcoder
[content deleted]


Last edited by asmcoder on 14 Aug 2009, 14:54; edited 1 time in total
Post 09 Dec 2008, 20:22
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
asmcoder,

Code section can be E-only (at least when you don't need to read from/write to it).

Merging sections is not an easy effort regarding [un]initialized data. Though they can reside in a single section (I forgot to mention: in Windows, section name does matter, see UPX sources or OLEAUT32.DLL code).

And last, but not least: sections in PE executable are made of sections in COFF object files with linker involved. Wink
Post 09 Dec 2008, 21:00
View user's profile Send private message Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan
.text: IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE | IMAGE_SCN_MEM_READ
Page protection for execution implies read attribute althou read section attr is not necessary for smart (i believe) MS loader.
Post 10 Dec 2008, 09:00
View user's profile Send private message 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. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.