1 /* $NetBSD: coff_machdep.h,v 1.5 2002/03/17 17:55:24 uch Exp $ */
4 * Copyright (c) 1994, 1995 Scott Bartram
7 * adapted from sys/sys/exec_ecoff.h
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #ifndef _SH3_COFF_MACHDEP_H_
34 #define _SH3_COFF_MACHDEP_H_
37 #define COFF_MAGIC_SH3_BIG 0x500
38 #define COFF_MAGIC_SH3_LITTLE 0x550
41 #define COFF_OMAGIC 0444 /* text not write-protected; data seg
42 is contiguous with text */
43 #define COFF_NMAGIC 0410 /* text is write-protected; data starts
44 at next seg following text */
45 #define COFF_ZMAGIC 0000 /* text and data segs are aligned for
47 #define COFF_SMAGIC 0443 /* shared lib */
49 #define COFF_LDPGSZ 4096
51 #define COFF_SEGMENT_ALIGNMENT(fp, ap) \
52 (((fp)->f_flags & COFF_F_EXEC) == 0 ? 4 : 16)
55 #error Define _BYTE_ORDER!
58 #if _BYTE_ORDER == BIG_ENDIAN
59 #define COFF_BADMAG(ex) ((ex)->f_magic != COFF_MAGIC_SH3_BIG)
61 #if _BYTE_ORDER == LITTLE_ENDIAN
62 #define COFF_BADMAG(ex) ((ex)->f_magic != COFF_MAGIC_SH3_LITTLE)
65 #define IBCS2_HIGH_SYSCALL(n) (((n) & 0x7f) == 0x28)
66 #define IBCS2_CVT_HIGH_SYSCALL(n) (((n) >> 8) + 128)
69 #define DPRINTF(a) printf a;
74 #define COFF_ES_SYMNMLEN 8
75 #define COFF_ES_SYMENTSZ 18
77 struct external_syment
{
79 char e_name
[COFF_ES_SYMNMLEN
];
92 #endif /* !_SH3_COFF_MACHDEP_H_ */