Motorola dsp assembler Reference Manual



Yüklə 4,8 Kb.
Pdf görüntüsü
səhifə72/91
tarix08.10.2017
ölçüsü4,8 Kb.
#3546
1   ...   68   69   70   71   72   73   74   75   ...   91

Motorola DSP Object File Format (COFF)
Object File Structure
E-2
DSP ASSEMBLER REFERENCE MANUAL
MOTOROLA
The general layout of the object file is illustrated in Figure E-1.
Figure E-1 COFF File Basic Structure
The file header contains object file information such as timestamp, number of sections,
pointer to the symbol table, and file status flags. Depending on how the object file was
generated the optional header holds link or run time information. The optional header is
followed by a list of section headers. Each section header contains pointers to section da-
ta, relocation information, and line number entries. After the section headers comes the
raw data for all sections. If the object file is relocatable the raw data may be followed by a
block of relocation entries for all sections. If the original source file was compiled or as-
sembled with the -G debug option, the relocation information is followed by source line
number address entries. The symbol table contains information on program symbols use-
ful by both the Linker and the debugger. The string table may contain very long symbolic
names, comment text, or relocation expressions. Note that the last four groups (relocation
info, line number entries, symbol table, and string table) may not appear if the Linker -S
option is used to strip symbols from the object file.
FILE HEADER
OPTIONAL HEADER
Section 1 Header


Section 
n Header
Section 1 Contents


Section 
n Contents
Section 1 Relocation Info


Section 
n Relocation Info
Section 1 Line Numbers


Section 
n Line Numbers
SYMBOL TABLE
STRING TABLE


Motorola DSP Object File Format (COFF)
Object File Components
MOTOROLA
DSP ASSEMBLER REFERENCE MANUAL
E-3
E.3
  OBJECT FILE COMPONENTS
Following are detailed descriptions of each of the DSP COFF object file components.  The
descriptions include the purpose of the component, its structure in the object file, and
meanings of individual fields within the component.
E.3.1   File Header
The file header is the first component in a COFF object file. It contains information about
the object file itself and is used for negotiating other components within the file. There is
only one file header per object file. Figure E-2 shows the structure of the COFF file header.
Figure E-2 File Header Format
The magic number is a special code indicating the target machine for the object file
(DSP56000, DSP96000, etc.).  The number of sections is useful for scanning the list of
section headers.  The date and time stamp is kept in binary form and may contain a host-
dependent time value.  The f_symptr field contains a file byte offset to the beginning of
the symbol table.  The number of symbol table entries provides an upper bound for loop-
ing through the symbol table and an indirect means for accessing the start of the string
table.  The size of the optional header allows for jumping to the start of the section header
list.
Bytes
Declaration
Name
Description
    0-3
unsigned long
f_magic
Magic number
    4-7
unsigned long
f_nscns
Number of sections
  8-11
long int
f_timdat
Time and date when file was
created
12-15
long int
f_symptr
File pointer to the start of the
symbol table
16-19
long int
f_nsyms
Number of symbol table
entries
20-23
unsigned long
f_opthdr
Number of bytes in the optional
header
24-27
unsigned long
f_flags
Flags (see Figure E-3)


Motorola DSP Object File Format (COFF)
Object File Components
E-4
DSP ASSEMBLER REFERENCE MANUAL
MOTOROLA
The flags field is a set of bit flags which convey status information about the object file. It
is used primarily by Linkers, debuggers, and other loader software to determine whether
the file is valid for a particular requested operation. The individual bit flags are shown in
Figure E-3.
Figure E-3 File Header Flags
E.3.2   Optional Header
The COFF optional header ordinarily is used to hold system-dependent or runtime infor-
mation.  This allows different operating environments to store data that only that environ-
ment uses without forcing all COFF files to save space for that information.  General utility
programs can be made to work properly with any common object file.  This is done by
seeking past the optional header using the f_opthdr size field in the file header record.
The optional header in a Motorola DSP object file may contain two distinct types of infor-
mation, depending upon how the file was generated. If the file is a relocatable object file
it will have an optional header containing Linker information. If the file is an absolute object
file it will have an optional header containing runtime information. The runtime header is
similar to standard COFF a.out optional header formats.
Figure E-4 shows the Linker optional header. The module size field gives the size of the
entire object module. The data size field reflects the size of the entire raw data block within
the module. The endstr field points to an expression in the string table which originated
with the Assembler END directive (see Chapter 6); it indicates the starting address of the
module. If this field is negative or zero there is no end expression. The logical section
count is the count of sections in the object module created via the Assembler SECTION
directive (see Chapter 6). The counter count represents the number of COFF sections in
the file (analogous to the file header f_nscns field). The relocation entry and line number
counts hold the number of all relocation entries and line number records in the file. The
Mnemonic
Flag
Meaning
F_RELFLG
0000001
Relocation information stripped from file
F_EXEC
0000002
File is executable (no unresolved  external
references)
F_LNNO
0000004
Line numbers stripped from file
F_LSYMS
0000010
Local symbols stripped from file
F_CC
0010000
File produced by C compiler (Motorola
DSP only)


Yüklə 4,8 Kb.

Dostları ilə paylaş:
1   ...   68   69   70   71   72   73   74   75   ...   91




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə