Page 1 of 1

Sections in COFF files??

Posted: Fri Apr 25, 2003 1:39 am
by Perica
..

Re:Sections in COFF files??

Posted: Fri Apr 25, 2003 9:46 am
by Tim
Perica Senjak wrote:What exactly are sections?? (.text, .data, .bss, .rodata?);
A section is a stream of bytes inside an image. Each section typically has a name and a set of flags (e.g. executable, writeable). A section may or may not be initialised with data in the image; for example, the data for .bss doesn't exist within the image because it is cleared to zero on load.
Is there a way to disable certain sections when linking?
Depends on the linker. Typically you'd want to merge one section with another instead of throwing (important) data away.
Do any of you know of a good tutorial/documentation on this subject??
Your linker's documentation. Also, compilers typically have #pragma or __attribute__ options for putting data or code into a particular section.
Also, if you know of any documentation explaining the DJGPP COFF format..... please mention them here.
There isn't a DJGPP COFF format :), just a COFF format -- everyone uses the same (although Win32 COFF files are slightly different from Unix ones).

Do a search on the DJGPP site, http://www.delorie.com/. There is full documentation on the format there. Microsoft also have some on their web site, probably within the PE documentation.