xref: /openbsd-src/gnu/usr.bin/binutils-2.17/include/coff/m68k.h (revision 3d8817e467ea46cf4772788d6804dd293abfb01a)
1*3d8817e4Smiod /* coff information for M68K
2*3d8817e4Smiod 
3*3d8817e4Smiod    Copyright 2001 Free Software Foundation, Inc.
4*3d8817e4Smiod 
5*3d8817e4Smiod    This program is free software; you can redistribute it and/or modify
6*3d8817e4Smiod    it under the terms of the GNU General Public License as published by
7*3d8817e4Smiod    the Free Software Foundation; either version 2 of the License, or
8*3d8817e4Smiod    (at your option) any later version.
9*3d8817e4Smiod 
10*3d8817e4Smiod    This program is distributed in the hope that it will be useful,
11*3d8817e4Smiod    but WITHOUT ANY WARRANTY; without even the implied warranty of
12*3d8817e4Smiod    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13*3d8817e4Smiod    GNU General Public License for more details.
14*3d8817e4Smiod 
15*3d8817e4Smiod    You should have received a copy of the GNU General Public License
16*3d8817e4Smiod    along with this program; if not, write to the Free Software
17*3d8817e4Smiod    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
18*3d8817e4Smiod 
19*3d8817e4Smiod #ifndef GNU_COFF_M68K_H
20*3d8817e4Smiod #define GNU_COFF_M68K_H 1
21*3d8817e4Smiod 
22*3d8817e4Smiod #define L_LNNO_SIZE 2
23*3d8817e4Smiod #include "coff/external.h"
24*3d8817e4Smiod 
25*3d8817e4Smiod /* Motorola 68000/68008/68010/68020 */
26*3d8817e4Smiod #define	MC68MAGIC	0520
27*3d8817e4Smiod #define MC68KWRMAGIC	0520	/* writeable text segments */
28*3d8817e4Smiod #define	MC68TVMAGIC	0521
29*3d8817e4Smiod #define MC68KROMAGIC	0521	/* readonly shareable text segments */
30*3d8817e4Smiod #define MC68KPGMAGIC	0522	/* demand paged text segments */
31*3d8817e4Smiod #define	M68MAGIC	0210
32*3d8817e4Smiod #define	M68TVMAGIC	0211
33*3d8817e4Smiod 
34*3d8817e4Smiod /* This is the magic of the Bull dpx/2 */
35*3d8817e4Smiod #define MC68KBCSMAGIC	0526
36*3d8817e4Smiod 
37*3d8817e4Smiod /* This is Lynx's all-platform magic number for executables. */
38*3d8817e4Smiod 
39*3d8817e4Smiod #define LYNXCOFFMAGIC	0415
40*3d8817e4Smiod 
41*3d8817e4Smiod #define OMAGIC M68MAGIC
42*3d8817e4Smiod 
43*3d8817e4Smiod /* This intentionally does not include MC68KBCSMAGIC; it only includes
44*3d8817e4Smiod    magic numbers which imply that names do not have underscores.  */
45*3d8817e4Smiod #define M68KBADMAG(x) (((x).f_magic != MC68MAGIC) \
46*3d8817e4Smiod                     && ((x).f_magic != MC68KWRMAGIC) \
47*3d8817e4Smiod                     && ((x).f_magic != MC68TVMAGIC) \
48*3d8817e4Smiod                     && ((x).f_magic != MC68KROMAGIC) \
49*3d8817e4Smiod                     && ((x).f_magic != MC68KPGMAGIC) \
50*3d8817e4Smiod                     && ((x).f_magic != M68MAGIC) \
51*3d8817e4Smiod                     && ((x).f_magic != M68TVMAGIC) \
52*3d8817e4Smiod                     && ((x).f_magic != LYNXCOFFMAGIC))
53*3d8817e4Smiod 
54*3d8817e4Smiod /* Magic numbers for the a.out header.  */
55*3d8817e4Smiod 
56*3d8817e4Smiod #define PAGEMAGICEXECSWAPPED  0407 /* executable (swapped) */
57*3d8817e4Smiod #define PAGEMAGICPEXECSWAPPED 0410 /* pure executable (swapped) */
58*3d8817e4Smiod #define PAGEMAGICPEXECTSHLIB  0443 /* pure executable (target shared library) */
59*3d8817e4Smiod #define PAGEMAGICPEXECPAGED   0413 /* pure executable (paged) */
60*3d8817e4Smiod 
61*3d8817e4Smiod /********************** RELOCATION DIRECTIVES **********************/
62*3d8817e4Smiod 
63*3d8817e4Smiod struct external_reloc
64*3d8817e4Smiod {
65*3d8817e4Smiod   char r_vaddr[4];
66*3d8817e4Smiod   char r_symndx[4];
67*3d8817e4Smiod   char r_type[2];
68*3d8817e4Smiod #ifdef M68K_COFF_OFFSET
69*3d8817e4Smiod   char r_offset[4];
70*3d8817e4Smiod #endif
71*3d8817e4Smiod };
72*3d8817e4Smiod 
73*3d8817e4Smiod #define RELOC struct external_reloc
74*3d8817e4Smiod 
75*3d8817e4Smiod #ifdef M68K_COFF_OFFSET
76*3d8817e4Smiod #define RELSZ 14
77*3d8817e4Smiod #else
78*3d8817e4Smiod #define RELSZ 10
79*3d8817e4Smiod #endif
80*3d8817e4Smiod 
81*3d8817e4Smiod #endif /* GNU_COFF_M68K_H */
82