📄 filhdr.html
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<meta name="GENERATOR" content="Mozilla/4.61 [en] (Win95; I) [Netscape]">
<title>COFF: File Header</title>
</head>
<body>
<center><table BORDER=0 CELLSPACING=0 CELLPADDING=3 WIDTH="100%" >
<tr>
<td ALIGN=LEFT VALIGN=TOP BGCOLOR="#FFCC99"><b><font face="itc avant garde gothic,helvetica,arial">
<a href="/" target="_top">www.delorie.com</a>/<a href="/djgpp/" target="_top">djgpp</a>/<a href="/djgpp/doc/" target="_top">doc</a>/<a href="/djgpp/doc/coff/" target="_top">coff</a>/filhdr.html</font></b></td>
<td ALIGN=RIGHT VALIGN=TOP BGCOLOR="#FFCC99"><b><font face="itc avant garde gothic,helvetica,arial">
<a href="/search/">search</a></font></b></td>
</tr>
</table></center>
<center><b><font size=-1>COFF: File Header</font></b></center>
<pre>typedef struct {
unsigned short <b>f_magic</b>; /* magic number */
unsigned short <b>f_nscns</b>; /* number of sections */
unsigned long <b>f_timdat</b>; /* time & date stamp */
unsigned long <b>f_symptr</b>; /* file pointer to symtab */
unsigned long <b>f_nsyms</b>; /* number of symtab entries */
unsigned short <b>f_opthdr</b>; /* sizeof(optional hdr) */
unsigned short <b>f_flags</b>; /* flags */
} <b>FILHDR</b>;</pre>
This structure always exists at the beginning of the COFF object. When
reading this header, you should read <b><tt>FILHSZ</tt></b> bytes, and
not rely on <tt>sizeof(FILHDR)</tt> to give the correct size.
<dl>
<dt>
<tt>f_magic</tt> - magic number</dt>
<dd>
This is a constant value for all COFF files, and is used to detect the
fact that the file is COFF. The value of this field must be <tt>I386MAGIC</tt>
(<tt>0x14c</tt>) and is stored in little-endian format, so the first two
bytes of any DJGPP COFF file are
<tt>0x4c</tt> and <tt>0x01</tt>.</dd>
<dt>
<tt>f_nscns</tt> - number of sections</dt>
<dd>
The number of sections (and thus <a href="scnhdr.html">section headers</a>)
contained within this file.</dd>
<dt>
<tt>f_timdat</tt> - file time & date stamp</dt>
<dd>
The time that this coff file was created. The value has the same meaning
as the <tt>time_t</tt> type.</dd>
<dt>
<tt>f_symptr</tt> - symbol table pointer</dt>
<dd>
Contains the file offset of the symbol table.</dd>
<dt>
<tt>f_nsyms</tt> - number of symbols in the symbol table</dt>
<dd>
The number of symbols in the symbol table.</dd>
<dt>
<tt>f_opthdr</tt> - optional header size</dt>
<dd>
The number of extra bytes that follow the file header, before the section
headers begin. Often used to store the optional a.out header. Regardless
of what optional header you expect, you should read (or skip) exactly the
number of bytes given in this field before reading <a href="scnhdr.html">the
section headers</a>.</dd>
<dt>
<tt>f_flags</tt> - flag bits</dt>
<dd>
These flags provide additional information about the state of this coff
object. The flags are as follows:</dd>
<center><table>
<tr>
<th>Bit
<hr noshade size=1></th>
<th>Symbol
<hr noshade size=1></th>
<th>Meaning
<hr noshade size=1></th>
</tr>
<tr VALIGN=TOP>
<td><tt>0x0001</tt></td>
<td><tt>F_RELFLG</tt></td>
<td>If set, there is no relocation information in this file. This is usually
clear for objects and set for executables.</td>
</tr>
<tr VALIGN=TOP>
<td><tt>0x0002</tt></td>
<td><tt>F_EXEC</tt></td>
<td>If set, all unresolved symbols have been resolved and the file may
be considered <i>executable.</i></td>
</tr>
<tr VALIGN=TOP>
<td><tt>0x0004</tt></td>
<td><tt>F_LNNO</tt></td>
<td>If set, all line number information has been removed from the file
(or was never added in the first place).</td>
</tr>
<tr VALIGN=TOP>
<td><tt>0x0008</tt></td>
<td><tt>F_LSYMS</tt></td>
<td>If set, all the local symbols have been removed from the file (or were
never added in the first place).</td>
</tr>
<tr VALIGN=TOP>
<td><tt>0x0100</tt></td>
<td><tt>F_AR32WR</tt></td>
<td>Indicates that the file is 32-bit little endian</td>
</tr>
</table></center>
</dl>
<center><table BORDER=0 CELLSPACING=0 CELLPADDING=3 WIDTH="100%" >
<tr>
<td ALIGN=LEFT VALIGN=TOP BGCOLOR="#FFCC99"><b><font face="itc avant garde gothic,helvetica,arial">
<a href="/users/dj/" target="_top">webmaster</a>
<a href="/donations.html" target="_top">donations</a> <a href="/store/books/" target="_top">bookstore</a></font></b></td>
<td ALIGN=RIGHT VALIGN=TOP BGCOLOR="#FFCC99"><b><font face="itc avant garde gothic,helvetica,arial">
<a href="/" target="_top">delorie
software</a> <a href="/privacy.html" target="_top">privacy</a></font></b></td>
</tr>
<tr>
<td ALIGN=LEFT VALIGN=TOP BGCOLOR="#FFCC99"><b><font face="itc avant garde gothic,helvetica,arial">
<a href="/copyright.html" target="_top">Copyright
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -