annotate tool/coffstruct.h @ 7:5a6f608173c4

first patch implemented: tpudrv-quadband
author Space Falcon <falcon@ivan.Harhan.ORG>
date Sat, 06 Jun 2015 05:16:19 +0000
parents 87e9f30f5f86
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
2 * Here we are going to define the structures found in the COFF artifact
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
3 * file to be analyzed.
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
4 */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
5
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
6 struct external_filehdr {
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
7 u_char f_magic[2]; /* magic number */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
8 u_char f_nscns[2]; /* number of sections */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
9 u_char f_timdat[4]; /* time & date stamp */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
10 u_char f_symptr[4]; /* file pointer to symtab */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
11 u_char f_nsyms[4]; /* number of symtab entries */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
12 u_char f_opthdr[2]; /* sizeof(optional hdr) */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
13 u_char f_flags[2]; /* flags */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
14 u_char f_target_id[2]; /* magic no. (TI COFF-specific) */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
15 };
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
16
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
17 struct external_scnhdr {
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
18 u_char s_name[8]; /* section name */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
19 u_char s_paddr[4]; /* physical address, aliased s_nlib */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
20 u_char s_vaddr[4]; /* virtual address */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
21 u_char s_size[4]; /* section size (in WORDS) */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
22 u_char s_scnptr[4]; /* file ptr to raw data for section */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
23 u_char s_relptr[4]; /* file ptr to relocation */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
24 u_char s_lnnoptr[4]; /* file ptr to line numbers */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
25 u_char s_nreloc[4]; /* number of relocation entries */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
26 u_char s_nlnno[4]; /* number of line number entries*/
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
27 u_char s_flags[4]; /* flags */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
28 u_char s_reserved[2]; /* reserved */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
29 u_char s_page[2]; /* section page number (LOAD) */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
30 };
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
31
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
32 struct external_syment {
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
33 u_char e_name[8];
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
34 u_char e_value[4];
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
35 u_char e_scnum[2];
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
36 u_char e_type[2];
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
37 u_char e_sclass;
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
38 u_char e_numaux;
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
39 };
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
40
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
41 struct external_reloc {
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
42 u_char r_vaddr[4];
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
43 u_char r_symndx[4];
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
44 u_char r_reserved[2]; /* extended pmad byte for COFF2 */
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
45 u_char r_type[2];
87e9f30f5f86 ti-libpatch: patching implemented
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
46 };