?? ti.h
字號:
#define COFF_ADJUST_SCNHDR_IN_POST(ABFD,EXT,INT) \do { ((struct internal_scnhdr *)(INT))->s_page = \GET_SCNHDR_PAGE(ABFD,(bfd_byte *)((SCNHDR *)(EXT))->s_page); \} while(0)/* The line number and reloc overflow checking in coff_swap_scnhdr_out in coffswap.h doesn't use PUT_X for s_nlnno and s_nreloc. Due to different sized v0/v1/v2 section headers, we have to re-write these fields. */#define COFF_ADJUST_SCNHDR_OUT_POST(ABFD,INT,EXT) \do { \PUT_SCNHDR_NLNNO(ABFD,((struct internal_scnhdr *)(INT))->s_nlnno,\ (bfd_byte *)((SCNHDR *)(EXT))->s_nlnno); \PUT_SCNHDR_NRELOC(ABFD,((struct internal_scnhdr *)(INT))->s_nreloc,\ (bfd_byte *)((SCNHDR *)(EXT))->s_nreloc); \PUT_SCNHDR_FLAGS(ABFD,((struct internal_scnhdr *)(INT))->s_flags, \ (bfd_byte *)((SCNHDR *)(EXT))->s_flags); \PUT_SCNHDR_PAGE(ABFD,((struct internal_scnhdr *)(INT))->s_page, \ (bfd_byte *)((SCNHDR *)(EXT))->s_page); \} while(0)/* Page macros The first GDB port requires flags in its remote memory access commands to distinguish between data/prog space. Hopefully we can make this go away eventually. Stuff the page in the upper bits of a 32-bit address, since the c5x family only uses 16 or 23 bits. c2x, c5x and most c54x devices have 16-bit addresses, but the c548 has 23-bit program addresses. Make sure the page flags don't interfere. These flags are used by GDB to identify the destination page for addresses. *//* recognized load pages */#define PG_PROG 0x0 /* PROG page */#define PG_DATA 0x1 /* DATA page */#define ADDR_MASK 0x00FFFFFF#define PG_TO_FLAG(p) (((unsigned long)(p) & 0xFF) << 24)#define FLAG_TO_PG(f) (((f) >> 24) & 0xFF)/* * names of "special" sections */#define _TEXT ".text"#define _DATA ".data"#define _BSS ".bss"#define _CINIT ".cinit" /* initialized C data */#define _SCONST ".const" /* constants */#define _SWITCH ".switch" /* switch tables */#define _STACK ".stack" /* C stack */#define _SYSMEM ".sysmem" /* used for malloc et al. syscalls *//********************** 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 external_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 LINENO struct external_lineno#define LINESZ 6/********************** SYMBOLS **********************//* NOTE: this is what a local label looks like in assembly source; what it looks like in COFF output is undefined */#define TICOFF_LOCAL_LABEL_P(NAME) \((NAME[0] == '$' && NAME[1] >= '0' && NAME[1] <= '9' && NAME[2] == '\0') \ || NAME[strlen(NAME)-1] == '?')#define E_SYMNMLEN 8 /* # characters in a symbol name */#define E_FILNMLEN 14 /* # characters in a file name */#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */struct external_syment { union { char e_name[E_SYMNMLEN]; struct { char e_zeroes[4]; char e_offset[4]; } e; } e; char e_value[4]; char e_scnum[2]; char e_type[2]; char e_sclass[1]; char e_numaux[1];};#define N_BTMASK (017)#define N_TMASK (060)#define N_BTSHFT (4)#define N_TSHIFT (2) union external_auxent { 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; union { char x_fname[E_FILNMLEN]; struct { char x_zeroes[4]; char x_offset[4]; } x_n; } x_file; struct { char x_scnlen[4]; /* section length */ char x_nreloc[2]; /* # relocation entries */ char x_nlinno[2]; /* # line numbers */ } x_scn; 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 SYMENT struct external_syment#define SYMESZ 18 #define AUXENT union external_auxent#define AUXESZ 18/* section lengths are in target bytes (not host bytes) */#define GET_SCN_SCNLEN(ABFD,EXT) \(bfd_h_get_32(ABFD,(bfd_byte *)(EXT)->x_scn.x_scnlen)*bfd_octets_per_byte(ABFD))#define PUT_SCN_SCNLEN(ABFD,INT,EXT) \bfd_h_put_32(ABFD,(INT)/bfd_octets_per_byte(ABFD),\ (bfd_byte *)(EXT)->x_scn.x_scnlen)/* lnsz size is in bits in COFF file, in bytes in BFD */#define GET_LNSZ_SIZE(abfd, ext) \(bfd_h_get_16(abfd, (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_size) / \ (class != C_FIELD ? 8 : 1))#define PUT_LNSZ_SIZE(abfd, in, ext) \ bfd_h_put_16(abfd, ((class != C_FIELD) ? (in)*8 : (in)), \ (bfd_byte*) ext->x_sym.x_misc.x_lnsz.x_size) /* TI COFF stores offsets for MOS and MOU in bits; BFD expects bytes */#define COFF_ADJUST_SYM_IN_POST(ABFD,EXT,INT) \do { struct internal_syment *dst = (struct internal_syment *)(INT); \if (dst->n_sclass == C_MOS || dst->n_sclass == C_MOU) dst->n_value /= 8; \} while (0)#define COFF_ADJUST_SYM_OUT_POST(ABFD,INT,EXT) \do { struct internal_syment *src = (struct internal_syment *)(INT); \SYMENT *dst = (SYMENT *)(EXT); \if(src->n_sclass == C_MOU || src->n_sclass == C_MOS) \bfd_h_put_32(abfd,src->n_value * 8,(bfd_byte *)dst->e_value); \} while (0)/* Detect section-relative absolute symbols so they get flagged with a sym index of -1.*/#define SECTION_RELATIVE_ABSOLUTE_SYMBOL_P(RELOC,SECT) \((*(RELOC)->sym_ptr_ptr)->section->output_section == (SECT) \ && (RELOC)->howto->name[0] == 'A')/********************** RELOCATION DIRECTIVES **********************/struct external_reloc_v0 { char r_vaddr[4]; char r_symndx[2]; char r_reserved[2]; char r_type[2];};struct external_reloc { char r_vaddr[4]; char r_symndx[4]; char r_reserved[2]; /* extended pmad byte for COFF2 */ char r_type[2];};#define RELOC struct external_reloc#define RELSZ_V0 10 /* FIXME -- coffcode.h needs fixing */#define RELSZ 12 /* for COFF1/2 *//* various relocation types. */#define R_ABS 0x0000 /* no relocation */#define R_REL13 0x002A /* 13-bit direct reference (???) */#define R_PARTLS7 0x0028 /* 7 LSBs of an address */#define R_PARTMS9 0x0029 /* 9MSBs of an address */#define R_EXTWORD 0x002B /* 23-bit direct reference */#define R_EXTWORD16 0x002C /* 16-bit direct reference to 23-bit addr*/#define R_EXTWORDMS7 0x002D /* upper 7 bits of 23-bit address */#endif /* COFF_TI_H */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -