Initial import from FreeBSD RELENG_4:
[dragonfly.git] / gnu / usr.bin / as / config / te-hpux.h
1 /* Special version of <a.out.h> for use under hp-ux.
2    Copyright (C) 1988, 1992 Free Software Foundation, Inc.
3
4    This file is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 2, or (at your option)
7    any later version.
8
9    This file is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this file; if not, write to the Free Software
16    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
17
18 #define TE_HPUX
19
20 #define HP9000S200_ID (0x20C)
21 #define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (HP9000S200_ID)
22
23  /* hpux has "special" headers. */
24 #define H_GET_HEADER_SIZE(h)    (64)
25
26 #include "obj-format.h"
27
28 /* This stuff is from an old a.out.hpux.h.  It isn't used anymore,
29    (see obj-aout.c, obj_header_append) but I'm including it here for
30    context.  xoxorich. */
31
32 #if comment
33
34 /* The `exec' structure and overall layout must be close to HP's when
35    we are running on an HP system, otherwise we will not be able to
36    execute the resulting file. */
37
38 /* Allow this file to be included twice. */
39 #ifndef __GNU_EXEC_MACROS__
40
41 struct exec
42 {
43   unsigned short a_machtype;    /* machine type */
44   unsigned short a_info;        /* magic number */
45   unsigned long a_spare1;
46   unsigned long a_spare2;
47   unsigned long a_text;         /* length of text, in bytes */
48   unsigned long a_data;         /* length of data, in bytes */
49   unsigned long a_bss;          /* length of uninitialized data area for file, in bytes */
50   unsigned long a_trsize;       /* length of relocation info for text, in bytes */
51   unsigned long a_drsize;       /* length of relocation info for data, in bytes */
52   unsigned long a_spare3;       /* HP = pascal interface size */
53   unsigned long a_spare4;       /* HP = symbol table size */
54   unsigned long a_spare5;       /* HP = debug name table size */
55   unsigned long a_entry;        /* start address */
56   unsigned long a_spare6;       /* HP = source line table size */
57   unsigned long a_spare7;       /* HP = value table size */
58   unsigned long a_syms;         /* length of symbol table data in file, in bytes */
59   unsigned long a_spare8;
60 };
61
62 /* Tell a.out.gnu.h not to define `struct exec'.  */
63 #define __STRUCT_EXEC_OVERRIDE__
64
65 #include "a.out.gnu.h"
66
67 #undef N_MAGIC
68 #undef N_MACHTYPE
69 #undef N_FLAGS
70 #undef N_SET_INFO
71 #undef N_SET_MAGIC
72 #undef N_SET_MACHTYPE
73 #undef N_SET_FLAGS
74
75 #define N_MAGIC(exec) ((exec) . a_magic)
76 #define N_MACHTYPE(exec) ((exec) . a_machtype)
77 #define N_SET_MAGIC(exec, magic) (((exec) . a_magic) = (magic))
78 #define N_SET_MACHTYPE(exec, machtype) (((exec) . a_machtype) = (machtype))
79
80 #undef N_BADMAG
81 #define N_BADMAG(x) ((_N_BADMAG (x)) || (_N_BADMACH (x)))
82
83 #define _N_BADMACH(x)                                                   \
84 (((N_MACHTYPE (x)) != HP9000S200_ID) &&                                 \
85  ((N_MACHTYPE (x)) != HP98x6_ID))
86
87 #define HP98x6_ID 0x20A
88 #define HP9000S200_ID 0x20C
89
90 #undef _N_HDROFF
91 #define _N_HDROFF(x) (SEGMENT_SIZE - (sizeof (struct exec)))
92
93 #define SEGMENT_SIZE 0x1000
94
95 #endif /* __GNU_EXEC_MACROS__ */
96
97 #endif /* comment */
98
99 /* end of te-hpux.h */