📄 coff.h
字号:
#define STYP_PAD 0x08 /* Padded section (not allocated, */ /* not relocated, loaded) */#define STYP_COPY 0x10 /* Copy section (for a decision */ /* function used in updating fields; */ /* not allocated, not relocated, */ /* loaded, relocation and line */ /* number entries processed */ /* normally) */#define STYP_TEXT 0x20 /* Section contains executable text */#define STYP_DATA 0x40 /* Section contains initialized data */#define STYP_BSS 0x80 /* Section contains only uninitialized data */#define STYP_INFO 0x200 /* Comment section (not allocated, */ /* not relocated, not loaded) */#define STYP_OVER 0x400 /* Overlay section (relocated, */ /* not allocated, not loaded) */#define STYP_LIB 0x800 /* For .lib section (like STYP_INFO) */#define STYP_BSSREG 0x1200 /* Global register area (like STYP_INFO) */#define STYP_ENVIR 0x2200 /* Environment (like STYP_INFO) */#define STYP_ABS 0x4000 /* Absolute (allocated, not reloc, loaded) */#define STYP_LIT 0x8020 /* Literal data (like STYP_TEXT) *//*NOTE: The use of STYP_BSSREG for relocation is not yet defined.*//*--------------------------------------------------------------*//*** Relocation information declaration and related definitions*/struct reloc { long r_vaddr; /* (virtual) address of reference */ long r_symndx; /* index into symbol table */ unsigned short r_type; /* relocation type */};#define RELOC struct reloc#define RELSZ 10 /* sizeof (RELOC) */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*//*** Relocation types for the Am29000 */#define R_ABS 0 /* reference is absolute */ #define R_IREL 030 /* instruction relative (jmp/call) */#define R_IABS 031 /* instruction absolute (jmp/call) */#define R_ILOHALF 032 /* instruction low half (const) */#define R_IHIHALF 033 /* instruction high half (consth) part 1 */#define R_IHCONST 034 /* instruction high half (consth) part 2 */ /* constant offset of R_IHIHALF relocation */#define R_BYTE 035 /* relocatable byte value */#define R_HWORD 036 /* relocatable halfword value */#define R_WORD 037 /* relocatable word value */#define R_IGLBLRC 040 /* instruction global register RC */#define R_IGLBLRA 041 /* instruction global register RA */#define R_IGLBLRB 042 /* instruction global register RB */ /*NOTE:All the "I" forms refer to Am29000 instruction formats. The linker is expected to know how the numeric information is split and/or alignedwithin the instruction word(s). R_BYTE works for instructions, too.If the parameter to a CONSTH instruction is a relocatable type, two relocation records are written. The first has an r_type of R_IHIHALF (33 octal) and a normal r_vaddr and r_symndx. The second relocation record has an r_type of R_IHCONST (34 octal), a normal r_vaddr (which is redundant), and an r_symndx containing the 32-bit constant offset to the relocation instead of the actual symbol table index. This second record is always written, even if the constant offset is zero.The constant fields of the instruction are set to zero.*//*--------------------------------------------------------------*//*** Line number entry declaration and related definitions*/struct lineno { union { long l_symndx; /* sym table index of function name */ long l_paddr; /* (physical) address of line number */ } l_addr; unsigned short l_lnno; /* line number */};#define LINENO struct lineno#define LINESZ 6 /* sizeof (LINENO) *//*--------------------------------------------------------------*//*** Symbol entry declaration and related definitions*/#define SYMNMLEN 8 /* Number of characters in a symbol name */struct syment { union { char _n_name [SYMNMLEN]; /* symbol name */ struct { long _n_zeroes; /* symbol name */ long _n_offset; /* offset into string table */ } _n_n; char *_n_nptr[2]; /* allows for overlaying */ } _n;#ifndef pdp11 unsigned#endif long n_value; /* value of symbol */ short n_scnum; /* section number */ unsigned short n_type; /* type and derived type */ char n_sclass; /* storage class */ char n_numaux; /* number of aux entries */};#define n_name _n._n_name#define n_nptr _n._n_nptr[1]#define n_zeroes _n._n_n._n_zeroes #define n_offset _n._n_n._n_offset#define SYMENT struct syment#define SYMESZ 18/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*//*** Storage class definitions - new classes for global registers.*/#define C_EFCN -1 /* physical end of a function */#define C_NULL 0 /* - */#define C_AUTO 1 /* automatic variable */#define C_EXT 2 /* external symbol */#define C_STAT 3 /* static */#define C_REG 4 /* (local) register variable */#define C_EXTDEF 5 /* external definition */#define C_LABEL 6 /* label */#define C_ULABEL 7 /* undefined label */#define C_MOS 8 /* member of structure */#define C_ARG 9 /* function argument */#define C_STRTAG 10 /* structure tag */#define C_MOU 11 /* member of union */#define C_UNTAG 12 /* union tag */#define C_TPDEF 13 /* type definition */#define C_UNSTATIC 14 /* uninitialized static */#define C_USTATIC 14 /* uninitialized static */#define C_ENTAG 15 /* enumeration tag */#define C_MOE 16 /* member of enumeration */#define C_REGPARM 17 /* register parameter */#define C_FIELD 18 /* bit field */#define C_GLBLREG 19 /* global register */#define C_EXTREG 20 /* external global register */#define C_DEFREG 21 /* ext. def. of global register */#define C_STARTOF 22 /* as29 $SIZEOF and $STARTOF symbols */#define C_BLOCK 100 /* beginning and end of block */#define C_FCN 101 /* beginning and end of function */#define C_EOS 102 /* end of structure */#define C_FILE 103 /* file name */#define C_LINE 104 /* used only by utility programs */#define C_ALIAS 105 /* duplicated tag */#define C_HIDDEN 106 /* like static, used to avoid name */ /* conflicts */#define C_SHADOW 107 /* shadow symbol *//* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*//*** Special section number definitions used in symbol entries.** (Section numbers 1-65535 are used to indicate the section** where the symbol was defined.)*/#define N_DEBUG -2 /* special symbolic debugging symbol */#define N_ABS -1 /* absolute symbol */#define N_UNDEF 0 /* undefined external symbol */#define N_SCNUM 1-65535 /* section num where symbol defined */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*//*** Fundamental symbol types.*/#define T_NULL 0 /* type not assigned */#define T_VOID 1 /* void */#define T_CHAR 2 /* character */#define T_SHORT 3 /* short integer */#define T_INT 4 /* integer */#define T_LONG 5 /* long integer */#define T_FLOAT 6 /* floating point */#define T_DOUBLE 7 /* double word */#define T_STRUCT 8 /* structure */#define T_UNION 9 /* union */#define T_ENUM 10 /* enumeration */#define T_MOE 11 /* member of enumeration */#define T_UCHAR 12 /* unsigned character */#define T_USHORT 13 /* unsigned short */#define T_UINT 14 /* unsigned integer */#define T_ULONG 15 /* unsigned long *//* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*//*** Derived symbol types.*/#define DT_NON 0 /* no derived type */#define DT_PTR 1 /* pointer */#define DT_FCN 2 /* function */#define DT_ARY 3 /* array *//*--------------------------------------------------------------*//*** Auxiliary symbol table entry declaration and related ** definitions.*/#define FILNMLEN 14 /* Number of characters in a file name */#define DIMNUM 4 /* Number of array dimensions in auxiliary entry */union auxent { struct { long x_tagndx; /* str, un, or enum tag indx */ union { struct { unsigned short x_lnno; /* declaration line number */ unsigned short x_size; /* str, union, array size */ } x_lnsz; long x_size; /* size of functions */ } x_misc; union { struct /* if ISFCN, tag, or .bb */ { long x_lnnoptr; /* ptr to fcn line # */ long x_endndx; /* entry ndx past block end */ } x_fcn; struct /* if ISARY, up to 4 dimen */ { unsigned short x_dimen[DIMNUM]; } x_ary; } x_fcnary; unsigned short x_tvndx; /* tv index */ } x_sym; struct { char x_fname[FILNMLEN]; } x_file; struct { long x_scnlen; /* section length */ unsigned short x_nreloc; /* number of relocation entries */ unsigned short x_nlinno; /* number of line numbers */ } x_scn; struct { long x_tvfill; /* tv fill value */ unsigned short x_tvlen; /* length of tv */ unsigned short x_tvrna[2]; /* tv range */ } x_tv; /* info about tv section (in auxent of symbol tv)) */};#define AUXENT union auxent#define AUXESZ 18 /* sizeof(AUXENT) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -