📄 coff-c55x.h
字号:
/* * Shared libraries have the following section header in the data field for * each library. */struct COFF_slib { char sl_entsz[4]; /* Size of this entry */ char sl_pathndx[4]; /* size of the header field */};#define COFF_SLIBHD struct COFF_slib#define COFF_SLIBSZ sizeof(COFF_SLIBHD)/********************** LINE NUMBERS **********************//* 1 line number entry for every "breakpointable" source line in a section. * Line numbers are grouped on a per function basis; first entry in a function * grouping will have l_lnno = 0 and in place of physical address will be the * symbol table index of the function name. */struct COFF_lineno { union { char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/ char l_paddr[4]; /* (physical) address of line number */ } l_addr; char l_lnno[2]; /* line number */};#define COFF_LINENO struct COFF_lineno#define COFF_LINESZ 6/* * cinit structure * T.Koba */struct COFF_cinit { char size[2]; char addr[3]; char flags[1]; char data[0];};#define COFF_CINIT struct COFF_cinit#define COFF_CINITSZ 6#define COFF_CINIT_FLAG_MEMORY 0x00#define COFF_CINIT_FLAG_IO 0x01/********************** SYMBOLS **********************/#define COFF_E_SYMNMLEN 8 /* # characters in a short symbol name */#define COFF_E_FILNMLEN 14 /* # characters in a file name */#define COFF_E_DIMNUM 4 /* # array dimensions in auxiliary entry *//* * All symbols and sections have the following definition */struct COFF_syment { union { char e_name[E_SYMNMLEN]; /* Symbol name (first 8 characters) */ struct { char e_zeroes[4]; /* Leading zeros */ char e_offset[4]; /* Offset if this is a header section */ } e; } e; char e_value[4]; /* Value (address) of the segment */ char e_scnum[2]; /* Section number */ char e_type[2]; /* Type of section */ char e_sclass[1]; /* Loader class */ char e_numaux[1]; /* Number of auxiliary entries which follow */};#define COFF_N_BTMASK (0xf) /* Mask for important class bits */#define COFF_N_TMASK (0x30) /* Mask for important type bits */#define COFF_N_BTSHFT (4) /* # bits to shift class field */#define COFF_N_TSHIFT (2) /* # bits to shift type field *//* * Storage class for c55x (T.Koba) */#define COFF_C_NULL 0#define COFF_C_AUTO 1#define COFF_C_EXT 2#define COFF_C_STAT 3#define COFF_C_REG 4#define COFF_C_EXTREF 5#define COFF_C_LABEL 6#define COFF_C_ULABEL 7#define COFF_C_MOS 8#define COFF_C_ARG 9#define COFF_C_STRTAG 10#define COFF_C_MOU 11#define COFF_C_UNTAG 12#define COFF_C_TPDEF 13#define COFF_C_USTATIC 14#define COFF_C_ENTAG 15#define COFF_C_MOE 16#define COFF_C_REGRARM 17#define COFF_C_FIELD 18#define COFF_C_BLOCK 100#define COFF_C_FCN 101#define COFF_C_EOS 102#define COFF_C_FILE 103#define COFF_C_LINE 104/* * Symbol type for c55x (T.Koba) */#define COFF_T_NULL 0#define COFF_T_CHAR 2#define COFF_T_SHORT 3#define COFF_T_INT 4#define COFF_T_LONG 5#define COFF_T_FLOAT 6#define COFF_T_DOUBLE 7#define COFF_T_STRUCT 8#define COFF_T_UNION 9#define COFF_T_ENUM 10#define COFF_T_MOE 11#define COFF_T_UCHAR 12#define COFF_T_USHORT 13#define COFF_DT_NON 0#define COFF_DT_PTR 1#define COFF_DT_FCN 2#define COFF_DT_ARY 3/* * Auxiliary entries because the main table is too limiting. */ union COFF_auxent {/* * Debugger information */ struct { char x_tagndx[4]; /* str, un, or enum tag indx */ union { struct { char x_lnno[2]; /* declaration line number */ char x_size[2]; /* str/union/array size */ } x_lnsz; char x_fsize[4]; /* size of function */ } x_misc; union { struct { /* if ISFCN, tag, or .bb */ char x_lnnoptr[4]; /* ptr to fcn line # */ char x_endndx[4]; /* entry ndx past block end */ } x_fcn; struct { /* if ISARY, up to 4 dimen. */ char x_dimen[E_DIMNUM][2]; } x_ary; } x_fcnary; char x_tvndx[2]; /* tv index */ } x_sym;/* * Source file names (debugger information) */ union { char x_fname[E_FILNMLEN]; struct { char x_zeroes[4]; char x_offset[4]; } x_n; } x_file;/* * Section information */ struct { char x_scnlen[4]; /* section length */ char x_nreloc[2]; /* # relocation entries */ char x_nlinno[2]; /* # line numbers */ } x_scn;/* * Transfer vector (branch table) */ struct { char x_tvfill[4]; /* tv fill value */ char x_tvlen[2]; /* length of .tv */ char x_tvran[2][2]; /* tv range */ } x_tv; /* info about .tv section (in auxent of symbol .tv)) */};#define COFF_SYMENT struct COFF_syment#define COFF_SYMESZ 18 #define COFF_AUXENT union COFF_auxent#define COFF_AUXESZ 18#define COFF_ETEXT "etext"/********************** RELOCATION DIRECTIVES **********************/struct COFF_reloc { char r_vaddr[4]; /* Virtual address of item */ char r_symndx[4]; /* Symbol index in the symtab */ char r_exa[2]; /* extended address calc */ char r_type[2]; /* Relocation type */};/* * Relocation Type: T.Koba */#define COFF_R_ABS 0x0000#define COFF_R_REL24 0x0005#define COFF_R_RELBYTE 0x000f#define COFF_R_RELWORD 0x0010#define COFF_R_RELLONG 0x0011#define COFF_R_LD3_DMA 0x0078#define COFF_R_LD3_MDP 0x007a#define COFF_R_LD3_PDP 0x007b#define COFF_R_LD3_REL23 0x007c#define COFF_R_LD3_k8 0x0088#define COFF_R_LD3_k16 0x0089#define COFF_R_LD3_K8 0x008a#define COFF_R_LD3_K16 0x008b#define COFF_R_LD3_l8 0x008c#define COFF_R_LD3_l16 0x008d#define COFF_R_LD3_L8 0x008e#define COFF_R_LD3_L16 0x008f#define COFF_R_LD3_k4 0x0090#define COFF_R_LD3_k5 0x0091#define COFF_R_LD3_K5 0x0092#define COFF_R_LD3_k6 0x0093#define COFF_R_LD3_k12 0x0094#define COFF_R_LD3_REL16 0x0095 // hacked#define COFF_R_EXTRA_BIT 0x4000#define COFF_R_EX_ADD 0x4000 // hacked#define COFF_R_EX_SUB 0x4001 // hacked#define COFF_R_EX_RSHIFT 0x4007 // hacked#define COFF_R_EX_MASK 0x4009 // hacked#define COFF_R_EX_WRITE1 0x400f // hacked (???)#define COFF_R_EX_WRITE2 0x4010 // hacked (???)#define COFF_R_EX_PSHSYM 0x4011 // hacked#define COFF_R_EX_PSHVAL 0x4013 // hacked#define COFF_R_EX_PSHINTOFF 0x4014 // hacked#define COFF_R_EX_WRITE3 0x4016 // hacked (???)#define COFF_RELOC struct COFF_reloc#define COFF_RELSZ 12#define COFF_DEF_DATA_SECTION_ALIGNMENT 4#define COFF_DEF_BSS_SECTION_ALIGNMENT 4#define COFF_DEF_TEXT_SECTION_ALIGNMENT 4/* For new sections we haven't heard of before */#define COFF_DEF_SECTION_ALIGNMENT 4#endif /* __COFF_C55X_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -