/* ECOFF support on MIPS machines.
coff/ecoff.h must be included before this file.
Copyright (C) 1999-2024 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
typedef struct external_aouthdr
{
unsigned char magic[2]; /* type of file */
unsigned char vstamp[2]; /* version stamp */
unsigned char tsize[4]; /* text size in bytes, padded to FW bdry*/
unsigned char dsize[4]; /* initialized data " " */
unsigned char bsize[4]; /* uninitialized data " " */
unsigned char entry[4]; /* entry pt. */
unsigned char text_start[4]; /* base of text used for this file */
unsigned char data_start[4]; /* base of data used for this file */
unsigned char bss_start[4]; /* base of bss used for this file */
unsigned char gprmask[4]; /* ?? */
unsigned char cprmask[4][4]; /* ?? */
unsigned char gp_value[4]; /* value for gp register */
} AOUTHDR;
/* Originally, ECOFF used four bits for the reloc type and had three
reserved bits. Irix 4 added another bit for the reloc type, which
was easy because it was big endian and one of the spare bits became
the new most significant bit. To make this also work for little
endian ECOFF, we need to wrap one of the reserved bits around to
become the most significant bit of the reloc type. */
#define RELOC_BITS3_TYPE_BIG 0x3E
#define RELOC_BITS3_TYPE_SH_BIG 1
#define RELOC_BITS3_TYPE_LITTLE 0x78
#define RELOC_BITS3_TYPE_SH_LITTLE 3
#define RELOC_BITS3_TYPEHI_LITTLE 0x04
#define RELOC_BITS3_TYPEHI_SH_LITTLE 2
/* The r_type field in a reloc is one of the following values. I
don't know if any other values can appear. These seem to be all
that occur in the Ultrix 4.2 libraries. */
#define MIPS_R_IGNORE 0
#define MIPS_R_REFHALF 1
#define MIPS_R_REFWORD 2
#define MIPS_R_JMPADDR 3
#define MIPS_R_REFHI 4
#define MIPS_R_REFLO 5
#define MIPS_R_GPREL 6
#define MIPS_R_LITERAL 7
/* FIXME: This relocation is used (internally only) to represent branches
when assembling. It should never appear in output files, and
be removed. (It used to be used for embedded-PIC support.) */
#define MIPS_R_PCREL16 12
/********************** SYMBOLIC INFORMATION **********************/
/* Written by John Gilmore. */
/* ECOFF uses COFF-like section structures, but its own symbol format.
This file defines the symbol format in fields whose size and alignment
will not vary on different host systems. */