xref: /netbsd-src/external/gpl3/binutils.old/dist/include/aout/hp.h (revision e992f068c547fd6e84b3f104dc2340adcc955732)
175fd0b74Schristos /* Special version of <a.out.h> for use under HP-UX.
2*e992f068Schristos    Copyright (C) 1988-2022 Free Software Foundation, Inc.
375fd0b74Schristos 
475fd0b74Schristos    This program is free software; you can redistribute it and/or modify
575fd0b74Schristos    it under the terms of the GNU General Public License as published by
675fd0b74Schristos    the Free Software Foundation; either version 3 of the License, or
775fd0b74Schristos    (at your option) any later version.
875fd0b74Schristos 
975fd0b74Schristos    This program is distributed in the hope that it will be useful,
1075fd0b74Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1175fd0b74Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1275fd0b74Schristos    GNU General Public License for more details.
1375fd0b74Schristos 
1475fd0b74Schristos    You should have received a copy of the GNU General Public License
1575fd0b74Schristos    along with this program; if not, write to the Free Software
1675fd0b74Schristos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
1775fd0b74Schristos    MA 02110-1301, USA.  */
1875fd0b74Schristos 
1975fd0b74Schristos /* THIS FILE IS OBSOLETE.  It needs to be revised as a variant "external"
2075fd0b74Schristos    a.out format for use with BFD.  */
2175fd0b74Schristos 
2275fd0b74Schristos /* The `exec' structure and overall layout must be close to HP's when
2375fd0b74Schristos    we are running on an HP system, otherwise we will not be able to
2475fd0b74Schristos    execute the resulting file. */
2575fd0b74Schristos 
2675fd0b74Schristos /* Allow this file to be included twice. */
2775fd0b74Schristos #ifndef __GNU_EXEC_MACROS__
2875fd0b74Schristos 
2975fd0b74Schristos struct exec
3075fd0b74Schristos {
3175fd0b74Schristos   unsigned short a_machtype;	/* machine type */
3275fd0b74Schristos   unsigned short a_magic;	/* magic number */
3375fd0b74Schristos   unsigned long a_spare1;
3475fd0b74Schristos   unsigned long a_spare2;
3575fd0b74Schristos   unsigned long a_text;		/* length of text, in bytes */
3675fd0b74Schristos   unsigned long a_data;		/* length of data, in bytes */
3775fd0b74Schristos   unsigned long a_bss;		/* length of uninitialized data area for file, in bytes */
3875fd0b74Schristos   unsigned long a_trsize;	/* length of relocation info for text, in bytes */
3975fd0b74Schristos   unsigned long a_drsize;	/* length of relocation info for data, in bytes */
4075fd0b74Schristos   unsigned long a_spare3;	/* HP = pascal interface size */
4175fd0b74Schristos   unsigned long a_spare4;	/* HP = symbol table size */
4275fd0b74Schristos   unsigned long a_spare5;	/* HP = debug name table size */
4375fd0b74Schristos   unsigned long a_entry;	/* start address */
4475fd0b74Schristos   unsigned long a_spare6;	/* HP = source line table size */
4575fd0b74Schristos   unsigned long a_spare7;	/* HP = value table size */
4675fd0b74Schristos   unsigned long a_syms;		/* length of symbol table data in file, in bytes */
4775fd0b74Schristos   unsigned long a_spare8;
4875fd0b74Schristos };
4975fd0b74Schristos 
5075fd0b74Schristos /* Tell a.out.gnu.h not to define `struct exec'.  */
5175fd0b74Schristos #define __STRUCT_EXEC_OVERRIDE__
5275fd0b74Schristos 
5375fd0b74Schristos #include "../a.out.gnu.h"
5475fd0b74Schristos 
5575fd0b74Schristos #undef N_MAGIC
5675fd0b74Schristos #undef N_MACHTYPE
5775fd0b74Schristos #undef N_FLAGS
5875fd0b74Schristos #undef N_SET_INFO
5975fd0b74Schristos #undef N_SET_MAGIC
6075fd0b74Schristos #undef N_SET_MACHTYPE
6175fd0b74Schristos #undef N_SET_FLAGS
6275fd0b74Schristos 
6375fd0b74Schristos #define N_MAGIC(execp) ((execp)->a_magic)
6475fd0b74Schristos #define N_MACHTYPE(execp) ((execp)->a_machtype)
6575fd0b74Schristos #define N_SET_MAGIC(execp, magic) (((execp)->a_magic) = (magic))
6675fd0b74Schristos #define N_SET_MACHTYPE(execp, machtype) (((execp)->a_machtype) = (machtype))
6775fd0b74Schristos 
6875fd0b74Schristos #undef N_BADMAG
6975fd0b74Schristos #define N_BADMAG(x) ((_N_BADMAG (x)) || (_N_BADMACH (x)))
7075fd0b74Schristos 
7175fd0b74Schristos #define _N_BADMACH(x)							\
7275fd0b74Schristos (((N_MACHTYPE (x)) != HP9000S200_ID) &&					\
7375fd0b74Schristos  ((N_MACHTYPE (x)) != HP98x6_ID))
7475fd0b74Schristos 
7575fd0b74Schristos #define HP98x6_ID 0x20A
7675fd0b74Schristos #define HP9000S200_ID 0x20C
7775fd0b74Schristos 
7875fd0b74Schristos #undef _N_HDROFF
7975fd0b74Schristos #define _N_HDROFF(x) (SEGMENT_SIZE - (sizeof (struct exec)))
8075fd0b74Schristos 
8175fd0b74Schristos #define SEGMENT_SIZE 0x1000
8275fd0b74Schristos 
8375fd0b74Schristos #endif /* __GNU_EXEC_MACROS__ */
84