1b075ecf2Schristos /* Special version of <a.out.h> for use under HP-UX.
2*f22f0ef4Schristos    Copyright (C) 1988-2022 Free Software Foundation, Inc.
32a6b7db3Sskrll 
42a6b7db3Sskrll    This program is free software; you can redistribute it and/or modify
52a6b7db3Sskrll    it under the terms of the GNU General Public License as published by
6b075ecf2Schristos    the Free Software Foundation; either version 3 of the License, or
72a6b7db3Sskrll    (at your option) any later version.
82a6b7db3Sskrll 
92a6b7db3Sskrll    This program is distributed in the hope that it will be useful,
102a6b7db3Sskrll    but WITHOUT ANY WARRANTY; without even the implied warranty of
112a6b7db3Sskrll    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
122a6b7db3Sskrll    GNU General Public License for more details.
132a6b7db3Sskrll 
142a6b7db3Sskrll    You should have received a copy of the GNU General Public License
152a6b7db3Sskrll    along with this program; if not, write to the Free Software
16b075ecf2Schristos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
17b075ecf2Schristos    MA 02110-1301, USA.  */
182a6b7db3Sskrll 
192a6b7db3Sskrll /* THIS FILE IS OBSOLETE.  It needs to be revised as a variant "external"
202a6b7db3Sskrll    a.out format for use with BFD.  */
212a6b7db3Sskrll 
222a6b7db3Sskrll /* The `exec' structure and overall layout must be close to HP's when
232a6b7db3Sskrll    we are running on an HP system, otherwise we will not be able to
242a6b7db3Sskrll    execute the resulting file. */
252a6b7db3Sskrll 
262a6b7db3Sskrll /* Allow this file to be included twice. */
272a6b7db3Sskrll #ifndef __GNU_EXEC_MACROS__
282a6b7db3Sskrll 
292a6b7db3Sskrll struct exec
302a6b7db3Sskrll {
312a6b7db3Sskrll   unsigned short a_machtype;	/* machine type */
322a6b7db3Sskrll   unsigned short a_magic;	/* magic number */
332a6b7db3Sskrll   unsigned long a_spare1;
342a6b7db3Sskrll   unsigned long a_spare2;
352a6b7db3Sskrll   unsigned long a_text;		/* length of text, in bytes */
362a6b7db3Sskrll   unsigned long a_data;		/* length of data, in bytes */
372a6b7db3Sskrll   unsigned long a_bss;		/* length of uninitialized data area for file, in bytes */
382a6b7db3Sskrll   unsigned long a_trsize;	/* length of relocation info for text, in bytes */
392a6b7db3Sskrll   unsigned long a_drsize;	/* length of relocation info for data, in bytes */
402a6b7db3Sskrll   unsigned long a_spare3;	/* HP = pascal interface size */
412a6b7db3Sskrll   unsigned long a_spare4;	/* HP = symbol table size */
422a6b7db3Sskrll   unsigned long a_spare5;	/* HP = debug name table size */
432a6b7db3Sskrll   unsigned long a_entry;	/* start address */
442a6b7db3Sskrll   unsigned long a_spare6;	/* HP = source line table size */
452a6b7db3Sskrll   unsigned long a_spare7;	/* HP = value table size */
462a6b7db3Sskrll   unsigned long a_syms;		/* length of symbol table data in file, in bytes */
472a6b7db3Sskrll   unsigned long a_spare8;
482a6b7db3Sskrll };
492a6b7db3Sskrll 
502a6b7db3Sskrll /* Tell a.out.gnu.h not to define `struct exec'.  */
512a6b7db3Sskrll #define __STRUCT_EXEC_OVERRIDE__
522a6b7db3Sskrll 
532a6b7db3Sskrll #include "../a.out.gnu.h"
542a6b7db3Sskrll 
552a6b7db3Sskrll #undef N_MAGIC
562a6b7db3Sskrll #undef N_MACHTYPE
572a6b7db3Sskrll #undef N_FLAGS
582a6b7db3Sskrll #undef N_SET_INFO
592a6b7db3Sskrll #undef N_SET_MAGIC
602a6b7db3Sskrll #undef N_SET_MACHTYPE
612a6b7db3Sskrll #undef N_SET_FLAGS
622a6b7db3Sskrll 
6375f9f1baSchristos #define N_MAGIC(execp) ((execp)->a_magic)
6475f9f1baSchristos #define N_MACHTYPE(execp) ((execp)->a_machtype)
6575f9f1baSchristos #define N_SET_MAGIC(execp, magic) (((execp)->a_magic) = (magic))
6675f9f1baSchristos #define N_SET_MACHTYPE(execp, machtype) (((execp)->a_machtype) = (machtype))
672a6b7db3Sskrll 
682a6b7db3Sskrll #undef N_BADMAG
692a6b7db3Sskrll #define N_BADMAG(x) ((_N_BADMAG (x)) || (_N_BADMACH (x)))
702a6b7db3Sskrll 
712a6b7db3Sskrll #define _N_BADMACH(x)							\
722a6b7db3Sskrll (((N_MACHTYPE (x)) != HP9000S200_ID) &&					\
732a6b7db3Sskrll  ((N_MACHTYPE (x)) != HP98x6_ID))
742a6b7db3Sskrll 
752a6b7db3Sskrll #define HP98x6_ID 0x20A
762a6b7db3Sskrll #define HP9000S200_ID 0x20C
772a6b7db3Sskrll 
782a6b7db3Sskrll #undef _N_HDROFF
792a6b7db3Sskrll #define _N_HDROFF(x) (SEGMENT_SIZE - (sizeof (struct exec)))
802a6b7db3Sskrll 
812a6b7db3Sskrll #define SEGMENT_SIZE 0x1000
822a6b7db3Sskrll 
832a6b7db3Sskrll #endif /* __GNU_EXEC_MACROS__ */
84