Rev 5191 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5191 | Rev 6324 | ||
---|---|---|---|
1 | /* coff information for Sparc. |
1 | /* coff information for Sparc. |
2 | 2 | ||
3 | Copyright 2001, 2010 Free Software Foundation, Inc. |
3 | Copyright (C) 2001-2015 Free Software Foundation, Inc. |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify |
5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by |
6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 3 of the License, or |
7 | the Free Software Foundation; either version 3 of the License, or |
8 | (at your option) any later version. |
8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, |
10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. |
13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License |
15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software |
16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
17 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
18 | MA 02110-1301, USA. */ |
18 | MA 02110-1301, USA. */ |
19 | 19 | ||
20 | /* This file is an amalgamation of several standard include files that |
20 | /* This file is an amalgamation of several standard include files that |
21 | define coff format, such as filehdr.h, aouthdr.h, and so forth. In |
21 | define coff format, such as filehdr.h, aouthdr.h, and so forth. In |
22 | addition, all datatypes have been translated into character arrays of |
22 | addition, all datatypes have been translated into character arrays of |
23 | (presumed) equivalent size. This is necessary so that this file can |
23 | (presumed) equivalent size. This is necessary so that this file can |
24 | be used with different systems while still yielding the same results. */ |
24 | be used with different systems while still yielding the same results. */ |
25 | 25 | ||
26 | #define L_LNNO_SIZE 2 |
26 | #define L_LNNO_SIZE 2 |
27 | #define DO_NOT_DEFINE_SYMENT |
27 | #define DO_NOT_DEFINE_SYMENT |
28 | #define DO_NOT_DEFINE_AUXENT |
28 | #define DO_NOT_DEFINE_AUXENT |
29 | #include "coff/external.h" |
29 | #include "coff/external.h" |
30 | 30 | ||
31 | #define F_RELFLG (0x0001) /* relocation info stripped */ |
31 | #define F_RELFLG (0x0001) /* relocation info stripped */ |
32 | #define F_EXEC (0x0002) /* file is executable */ |
32 | #define F_EXEC (0x0002) /* file is executable */ |
33 | #define F_LNNO (0x0004) /* line numbers stripped */ |
33 | #define F_LNNO (0x0004) /* line numbers stripped */ |
34 | #define F_LSYMS (0x0008) /* local symbols stripped */ |
34 | #define F_LSYMS (0x0008) /* local symbols stripped */ |
35 | 35 | ||
36 | #define SPARCMAGIC (0540) |
36 | #define SPARCMAGIC (0540) |
37 | 37 | ||
38 | /* This is Lynx's all-platform magic number for executables. */ |
38 | /* This is Lynx's all-platform magic number for executables. */ |
39 | 39 | ||
40 | #define LYNXCOFFMAGIC (0415) |
40 | #define LYNXCOFFMAGIC (0415) |
41 | 41 | ||
42 | #define OMAGIC 0404 /* object files, eg as output */ |
42 | #define OMAGIC 0404 /* object files, eg as output */ |
43 | #define ZMAGIC 0413 /* demand load format, eg normal ld output */ |
43 | #define ZMAGIC 0413 /* demand load format, eg normal ld output */ |
44 | #define STMAGIC 0401 /* target shlib */ |
44 | #define STMAGIC 0401 /* target shlib */ |
45 | #define SHMAGIC 0443 /* host shlib */ |
45 | #define SHMAGIC 0443 /* host shlib */ |
46 | 46 | ||
47 | /* More names of "special" sections. */ |
47 | /* More names of "special" sections. */ |
48 | 48 | ||
49 | #define _TV ".tv" |
49 | #define _TV ".tv" |
50 | #define _INIT ".init" |
50 | #define _INIT ".init" |
51 | #define _FINI ".fini" |
51 | #define _FINI ".fini" |
52 | 52 | ||
53 | /********************** SYMBOLS **********************/ |
53 | /********************** SYMBOLS **********************/ |
54 | 54 | ||
55 | #define E_SYMNMLEN (8) /* # characters in a symbol name */ |
55 | #define E_SYMNMLEN (8) /* # characters in a symbol name */ |
56 | #define E_FILNMLEN (14) /* # characters in a file name */ |
56 | #define E_FILNMLEN (14) /* # characters in a file name */ |
57 | #define E_DIMNUM (4) /* # array dimensions in auxiliary entry */ |
57 | #define E_DIMNUM (4) /* # array dimensions in auxiliary entry */ |
58 | 58 | ||
59 | struct external_syment |
59 | struct external_syment |
60 | { |
60 | { |
61 | union { |
61 | union { |
62 | char e_name[E_SYMNMLEN]; |
62 | char e_name[E_SYMNMLEN]; |
63 | struct { |
63 | struct { |
64 | char e_zeroes[4]; |
64 | char e_zeroes[4]; |
65 | char e_offset[4]; |
65 | char e_offset[4]; |
66 | } e; |
66 | } e; |
67 | #if 0 /* of doubtful value */ |
67 | #if 0 /* of doubtful value */ |
68 | char e_nptr[2][4]; |
68 | char e_nptr[2][4]; |
69 | struct { |
69 | struct { |
70 | char e_leading_zero[1]; |
70 | char e_leading_zero[1]; |
71 | char e_dbx_type[1]; |
71 | char e_dbx_type[1]; |
72 | char e_dbx_desc[2]; |
72 | char e_dbx_desc[2]; |
73 | } e_dbx; |
73 | } e_dbx; |
74 | #endif |
74 | #endif |
75 | } e; |
75 | } e; |
76 | 76 | ||
77 | char e_value[4]; |
77 | char e_value[4]; |
78 | char e_scnum[2]; |
78 | char e_scnum[2]; |
79 | char e_type[2]; |
79 | char e_type[2]; |
80 | char e_sclass[1]; |
80 | char e_sclass[1]; |
81 | char e_numaux[1]; |
81 | char e_numaux[1]; |
82 | char padding[2]; |
82 | char padding[2]; |
83 | }; |
83 | }; |
84 | 84 | ||
85 | #define N_BTMASK (0xf) |
85 | #define N_BTMASK (0xf) |
86 | #define N_TMASK (0x30) |
86 | #define N_TMASK (0x30) |
87 | #define N_BTSHFT (4) |
87 | #define N_BTSHFT (4) |
88 | #define N_TSHIFT (2) |
88 | #define N_TSHIFT (2) |
89 | 89 | ||
90 | union external_auxent |
90 | union external_auxent |
91 | { |
91 | { |
92 | struct { |
92 | struct { |
93 | char x_tagndx[4]; /* str, un, or enum tag indx */ |
93 | char x_tagndx[4]; /* str, un, or enum tag indx */ |
94 | union { |
94 | union { |
95 | struct { |
95 | struct { |
96 | char x_lnno[2]; /* declaration line number */ |
96 | char x_lnno[2]; /* declaration line number */ |
97 | char x_size[2]; /* str/union/array size */ |
97 | char x_size[2]; /* str/union/array size */ |
98 | } x_lnsz; |
98 | } x_lnsz; |
99 | char x_fsize[4]; /* size of function */ |
99 | char x_fsize[4]; /* size of function */ |
100 | } x_misc; |
100 | } x_misc; |
101 | union { |
101 | union { |
102 | struct { /* if ISFCN, tag, or .bb */ |
102 | struct { /* if ISFCN, tag, or .bb */ |
103 | char x_lnnoptr[4]; /* ptr to fcn line # */ |
103 | char x_lnnoptr[4]; /* ptr to fcn line # */ |
104 | char x_endndx[4]; /* entry ndx past block end */ |
104 | char x_endndx[4]; /* entry ndx past block end */ |
105 | } x_fcn; |
105 | } x_fcn; |
106 | struct { /* if ISARY, up to 4 dimen. */ |
106 | struct { /* if ISARY, up to 4 dimen. */ |
107 | char x_dimen[E_DIMNUM][2]; |
107 | char x_dimen[E_DIMNUM][2]; |
108 | } x_ary; |
108 | } x_ary; |
109 | } x_fcnary; |
109 | } x_fcnary; |
110 | char x_tvndx[2]; /* tv index */ |
110 | char x_tvndx[2]; /* tv index */ |
111 | } x_sym; |
111 | } x_sym; |
112 | 112 | ||
113 | union { |
113 | union { |
114 | char x_fname[E_FILNMLEN]; |
114 | char x_fname[E_FILNMLEN]; |
115 | struct { |
115 | struct { |
116 | char x_zeroes[4]; |
116 | char x_zeroes[4]; |
117 | char x_offset[4]; |
117 | char x_offset[4]; |
118 | } x_n; |
118 | } x_n; |
119 | } x_file; |
119 | } x_file; |
120 | 120 | ||
121 | struct { |
121 | struct { |
122 | char x_scnlen[4]; /* section length */ |
122 | char x_scnlen[4]; /* section length */ |
123 | char x_nreloc[2]; /* # relocation entries */ |
123 | char x_nreloc[2]; /* # relocation entries */ |
124 | char x_nlinno[2]; /* # line numbers */ |
124 | char x_nlinno[2]; /* # line numbers */ |
125 | } x_scn; |
125 | } x_scn; |
126 | 126 | ||
127 | struct { |
127 | struct { |
128 | char x_tvfill[4]; /* tv fill value */ |
128 | char x_tvfill[4]; /* tv fill value */ |
129 | char x_tvlen[2]; /* length of .tv */ |
129 | char x_tvlen[2]; /* length of .tv */ |
130 | char x_tvran[2][2]; /* tv range */ |
130 | char x_tvran[2][2]; /* tv range */ |
131 | } x_tv; /* .tv section info (in auxent of sym .tv)) */ |
131 | } x_tv; /* .tv section info (in auxent of sym .tv)) */ |
132 | 132 | ||
133 | char x_fill[20]; /* forces to 20-byte size */ |
133 | char x_fill[20]; /* forces to 20-byte size */ |
134 | }; |
134 | }; |
135 | 135 | ||
136 | #define SYMENT struct external_syment |
136 | #define SYMENT struct external_syment |
137 | #define SYMESZ 20 |
137 | #define SYMESZ 20 |
138 | #define AUXENT union external_auxent |
138 | #define AUXENT union external_auxent |
139 | #define AUXESZ 20 |
139 | #define AUXESZ 20 |
140 | 140 | ||
141 | #define _ETEXT "etext" |
141 | #define _ETEXT "etext" |
142 | 142 | ||
143 | /********************** RELOCATION DIRECTIVES **********************/ |
143 | /********************** RELOCATION DIRECTIVES **********************/ |
144 | 144 | ||
145 | struct external_reloc |
145 | struct external_reloc |
146 | { |
146 | { |
147 | char r_vaddr[4]; |
147 | char r_vaddr[4]; |
148 | char r_symndx[4]; |
148 | char r_symndx[4]; |
149 | char r_type[2]; |
149 | char r_type[2]; |
150 | char r_spare[2]; |
150 | char r_spare[2]; |
151 | char r_offset[4]; |
151 | char r_offset[4]; |
152 | }; |
152 | }; |
153 | 153 | ||
154 | #define RELOC struct external_reloc |
154 | #define RELOC struct external_reloc |
155 | #define RELSZ 16 |
155 | #define RELSZ 16 |