Sections in COFF files??

Programming, for all ages and all languages.
Post Reply
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Sections in COFF files??

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 9:07 pm, edited 2 times in total.
Tim

Re:Sections in COFF files??

Post 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.
Post Reply