1 /* IBM RS/6000 "XCOFF64" file definitions for BFD.
3 Copyright 2000 Free Software Foundation, Inc.
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
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
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
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
19 #define DO_NOT_DEFINE_AOUTHDR
20 #define DO_NOT_DEFINE_SCNHDR
21 #define DO_NOT_DEFINE_LINENO
22 #define DO_NOT_DEFINE_AUXENT
23 #include "coff/external.h"
26 #define U803XTOCMAGIC 0757 /* readonly text segments and TOC, XCOFF64 */
28 #define BADMAG(x) ((x).f_magic != U803XTOCMAGIC)
30 /********************** AOUT "OPTIONAL HEADER" **********************/
34 unsigned char magic
[2]; /* type of file */
35 unsigned char vstamp
[2]; /* version stamp */
36 unsigned char o_debugger
[4]; /* reserved */
37 unsigned char text_start
[8]; /* base of text used for this file */
38 unsigned char data_start
[8]; /* base of data used for this file */
39 unsigned char o_toc
[8]; /* address of TOC */
40 unsigned char o_snentry
[2]; /* section number of entry point */
41 unsigned char o_sntext
[2]; /* section number of .text section */
42 unsigned char o_sndata
[2]; /* section number of .data section */
43 unsigned char o_sntoc
[2]; /* section number of TOC */
44 unsigned char o_snloader
[2]; /* section number of .loader section */
45 unsigned char o_snbss
[2]; /* section number of .bss section */
46 unsigned char o_algntext
[2]; /* .text alignment */
47 unsigned char o_algndata
[2]; /* .data alignment */
48 unsigned char o_modtype
[2]; /* module type (??) */
49 unsigned char o_cputype
[2]; /* cpu type */
50 unsigned char o_resv2
[4]; /* reserved */
51 unsigned char tsize
[8]; /* text size bytes, padded to FW bdry */
52 unsigned char dsize
[8]; /* initialized data " " */
53 unsigned char bsize
[8]; /* uninitialized data " " */
54 unsigned char entry
[8]; /* entry pt. */
55 unsigned char o_maxstack
[8]; /* max stack size (??) */
56 unsigned char o_maxdata
[8]; /* max data size (??) */
57 unsigned char o_resv3
[16]; /* reserved */
62 #define SMALL_AOUTSZ (0)
65 #define RS6K_AOUTHDR_OMAGIC 0x0107 /* old: text & data writeable */
66 #define RS6K_AOUTHDR_NMAGIC 0x0108 /* new: text r/o, data r/w */
67 #define RS6K_AOUTHDR_ZMAGIC 0x010B /* paged: text r/o, both page-aligned */
70 /********************** SECTION HEADER **********************/
71 struct external_scnhdr
73 char s_name
[8]; /* section name */
74 char s_paddr
[8]; /* physical address, aliased s_nlib */
75 char s_vaddr
[8]; /* virtual address */
76 char s_size
[8]; /* section size */
77 char s_scnptr
[8]; /* file ptr to raw data for section */
78 char s_relptr
[8]; /* file ptr to relocation */
79 char s_lnnoptr
[8]; /* file ptr to line numbers */
80 char s_nreloc
[4]; /* number of relocation entries */
81 char s_nlnno
[4]; /* number of line number entries*/
82 char s_flags
[4]; /* flags */
83 char s_pad
[4]; /* padding */
87 * names of "special" sections
93 #define _LOADER ".loader"
95 #define SCNHDR struct external_scnhdr
99 /* XCOFF uses a special .loader section with type STYP_LOADER. */
100 #define STYP_LOADER 0x1000
102 /* XCOFF uses a special .debug section with type STYP_DEBUG. */
103 #define STYP_DEBUG 0x2000
105 /* XCOFF handles line number or relocation overflow by creating
106 another section header with STYP_OVRFLO set. */
107 #define STYP_OVRFLO 0x8000
109 /********************** LINE NUMBERS **********************/
111 /* 1 line number entry for every "breakpointable" source line in a section.
112 Line numbers are grouped on a per function basis; first entry in a function
113 grouping will have l_lnno = 0 and in place of physical address will be the
114 symbol table index of the function name. */
115 struct external_lineno
119 char l_symndx
[8];/* function name symbol index, iff l_lnno == 0*/
120 char l_paddr
[8]; /* (physical) address of line number */
123 char l_lnno
[4]; /* line number */
126 #define LINENO struct external_lineno
130 union external_auxent
138 char x_lnno
[4]; /* declaration line number */
139 char x_size
[2]; /* str/union/array size */
144 char x_lnnoptr
[8];/* ptr to fcn line */
145 char x_fsize
[4]; /* size of function */
146 char x_endndx
[4]; /* entry ndx past block end */
155 char x_fname
[E_FILNMLEN
];
162 unsigned char x_ftype
[1];
163 unsigned char x_resv
[2];
178 unsigned char x_scnlen_lo
[4];
179 unsigned char x_parmhash
[4];
180 unsigned char x_snhash
[2];
181 unsigned char x_smtyp
[1];
182 unsigned char x_smclas
[1];
183 unsigned char x_scnlen_hi
[4];
184 unsigned char x_pad
[1];
194 #define AUXENT union external_auxent
197 #define DBXMASK 0x80 /* for dbx storage mask */
198 #define SYMNAME_IN_DEBUG(symptr) ((symptr)->n_sclass & DBXMASK)
200 /* Values for auxtype field in XCOFF64, taken from AIX 4.3 sym.h */
201 #define _AUX_EXCEPT 255
204 #define _AUX_FILE 252
205 #define _AUX_CSECT 251
207 /********************** RELOCATION DIRECTIVES **********************/
209 struct external_reloc
217 #define RELOC struct external_reloc
220 #define DEFAULT_DATA_SECTION_ALIGNMENT 4
221 #define DEFAULT_BSS_SECTION_ALIGNMENT 4
222 #define DEFAULT_TEXT_SECTION_ALIGNMENT 4
223 /* For new sections we havn't heard of before */
224 #define DEFAULT_SECTION_ALIGNMENT 4
This page took 0.033689 seconds and 4 git commands to generate.