Motorola dsp assembler Reference Manual



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

Motorola DSP Object File Format (COFF)
Object File Components
E-12
DSP ASSEMBLER REFERENCE MANUAL
MOTOROLA_DSP_ASSEMBLER_REFERENCE_MANUAL_E-13_Figure_E-12_Symbol_Table_Entry_Format_E.3.4.1_Symbol_Name'>MOTOROLA
Figure E-11 COFF Symbol Table Ordering
The entry for each symbol is a structure that holds the symbol value, its type, and other
information. There are symbol table entries used for relocation and linking and there are
special symbols used only for debugging. The two kinds of entries are distinguished by
combinations of field values in the symbol record. The structure of a symbol table entry is
illustrated in Figure E-12.
Filename 1
Function 1
Local symbols for function 1
Function 2
Local symbols for function 2
. . .
Statics
. . .
Filename 2
Function 1
Local symbols for function 1
. . .
Statics
. . .
Defined global symbols
Undefined global symbols


Motorola DSP Object File Format (COFF)
Object File Components
MOTOROLA
DSP ASSEMBLER REFERENCE MANUAL
E-13
Figure E-12 Symbol Table Entry Format
E.3.4.1  Symbol Name
The first eight bytes in the symbol table entry are a union of a character array and two
longs.  If the symbol name is seven characters or less, the null-padded symbol name is
stored there.  If the symbol name is longer than seven characters, then the entire symbol
name is stored in the string table.  In this case, the eight bytes contain two long integers:
the first is zero and the second is the offset (relative to the beginning of the string table)
of the name in the string table.  Since there can be no symbols with a null name, the ze-
roes on the first four bytes serve to distinguish a symbol table entry with an offset from
one with a name in the first eight bytes.
E.3.4.2  Symbol Value
The symbol value is a union of a CORE_ADDR typedef and an array of two longs. If the
symbol value is an address the contents will be stored as a CORE_ADDR structure with
memory and mapping attributes. Otherwise the contents are stored in the n_val field.
Whether the symbol value is an address or not depends on the storage class of the sym-
bol. See section E.3.4.5 for more information on the relationship of symbol value and stor-
age class.
Bytes
Declaration
Name
Description
    0-7
char
n_name
Symbol name (null padded)
    0-3
long int
n_zeroes
Zero in this field indicates name
is in string table
    4-7
long int
n_offset
Offset of name in string table
  8-15
CORE_ADDR
n_address
Symbol address value
  8-15
unsigned long
n_val[2]
Symbol value
16-19
long int
n_scnum
Symbol section number
20-23
unsigned long
n_type
Symbol basic and derived type
24-27
long int
n_sclass
Symbol storage class
28-31
long int
n_numaux
Number of auxiliary entries


Motorola DSP Object File Format (COFF)
Object File Components
E-14
DSP ASSEMBLER REFERENCE MANUAL
MOTOROLA
E.3.4.3  Section Number
The section number maps a symbol to its corresponding section in the object file (e.g. the
section in which the symbol is defined).  A special section number (-2) marks symbolic
debugging symbols, including structure/union/enumeration tag names, typedefs, and the
name of the file.  A section number of -1 indicates that the symbol has a value but is not
relocatable.  Examples of absolute-valued symbols include automatic and register vari-
ables, function arguments, and end-of-structure symbols.  A section number of 0 flags a
relocatable external symbol that is not defined in the current file.  Section numbers greater
than zero correlate to the ordinal sequence of sections in the object file.
E.3.4.4  Symbol Type
The type field in the symbol table entry contains information about the basic and derived
type for the symbol. This information is generated by the compiler and Assembler only if
the -G debug option is used. Each symbol has exactly one basic or fundamental type but
can have more than one derived type. The type information is encoded as sets of bits in
the field. Bits 0 through 3 hold one of the fundamental type values given in Figure E-13.


Motorola DSP Object File Format (COFF)
Object File Components
MOTOROLA
DSP ASSEMBLER REFERENCE MANUAL
E-15
Figure E-13 Fundamental Types
Bits 4 through 15 are arranged as six 2-bit subfields. These subfields represent levels of
the derived types given in Figure E-14.
Mnemonic
Value
Type
T_NULL
0
Type not assigned
T_VOID
1
Void
T_CHAR
2
Character
T_SHORT
3
Short integer
T_INT
4
Integer
T_LONG
5
Long integer
T_FLOAT
6
Floating point
T_DOUBLE
7
Double word floating point
T_STRUCT
8
Structure
T_UNION
9
Union
T_ENUM
10
Enumeration
T_MOE
11
Member of enumeration
T_UCHAR
12
Unsigned character
T_USHORT
13
Unsigned short
T_UINT
14
Unsigned integer
T_ULONG
15
Unsigned long


Motorola DSP Object File Format (COFF)
Object File Components
E-16
DSP ASSEMBLER REFERENCE MANUAL
MOTOROLA
Figure E-14 Derived Types
As an example of encoding fundamental and derived types, consider a function returning
a pointer to a character. The fundamental type is character, giving bits 0-3 of the symbol
type field the value 2. Bits 4-5 would hold a 2 for the derived type of function and bits 6-7
would contain a 1 for the pointer derived type. The value in the symbol entry type field
would result in %01100010 binary, or $62 hexadecimal.
E.3.4.5  Symbol Storage Class
The symbol storage class indicates how a symbol will be used during execution or debug-
ging. Some storage classes actually reflect how a symbol will be stored, e.g. as a register
parameter. Other storage classes provide information for special symbols used in debug-
ging, such as the beginning of blocks or the end of functions. Storage classes are outlined
in Figure E-15.
Mnemonic
Value
Type
DT_NON
0
No derived type
DT_PTR
1
Pointer
DT_FCN
2
Function
DT_ARY
3
Array


Yüklə 4,8 Kb.

Dostları ilə paylaş:
1   ...   71   72   73   74   75   76   77   78   ...   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ə