/* ECOFF support on Alpha machines.
coff/ecoff.h must be included before this file.
Copyright (C) 2001-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. */
/* The object type is encoded in the f_flags. */
#define F_ALPHA_OBJECT_TYPE_MASK 0x3000
#define F_ALPHA_NO_SHARED 0x1000
#define F_ALPHA_SHARABLE 0x2000
#define F_ALPHA_CALL_SHARED 0x3000
typedef struct external_aouthdr
{
unsigned char magic[2]; /* type of file */
unsigned char vstamp[2]; /* version stamp */
unsigned char bldrev[2]; /* ?? */
unsigned char padding[2]; /* pad to quadword boundary */
unsigned char tsize[8]; /* text size in bytes */
unsigned char dsize[8]; /* initialized data " " */
unsigned char bsize[8]; /* uninitialized data " " */
unsigned char entry[8]; /* entry pt. */
unsigned char text_start[8]; /* base of text used for this file */
unsigned char data_start[8]; /* base of data used for this file */
unsigned char bss_start[8]; /* base of bss used for this file */
unsigned char gprmask[4]; /* bitmask of general registers used */
unsigned char fprmask[4]; /* bitmask of floating point registers used */
unsigned char gp_value[8]; /* value for gp register */
} AOUTHDR;
/* The r_type field in a reloc is one of the following values. */
#define ALPHA_R_IGNORE 0
#define ALPHA_R_REFLONG 1
#define ALPHA_R_REFQUAD 2
#define ALPHA_R_GPREL32 3
#define ALPHA_R_LITERAL 4
#define ALPHA_R_LITUSE 5
#define ALPHA_R_GPDISP 6
#define ALPHA_R_BRADDR 7
#define ALPHA_R_HINT 8
#define ALPHA_R_SREL16 9
#define ALPHA_R_SREL32 10
#define ALPHA_R_SREL64 11
#define ALPHA_R_OP_PUSH 12
#define ALPHA_R_OP_STORE 13
#define ALPHA_R_OP_PSUB 14
#define ALPHA_R_OP_PRSHIFT 15
#define ALPHA_R_GPVALUE 16
#define ALPHA_R_GPRELHIGH 17
#define ALPHA_R_GPRELLOW 18
#define ALPHA_R_IMMED 19
/* Overloaded reloc value used by Net- and OpenBSD. */
#define ALPHA_R_LITERALSLEAZY 17
/* With ALPHA_R_LITUSE, the r_size field is one of the following values. */
#define ALPHA_R_LU_BASE 1
#define ALPHA_R_LU_BYTOFF 2
#define ALPHA_R_LU_JSR 3
/* With ALPHA_R_IMMED, the r_size field is one of the following values. */
#define ALPHA_R_IMMED_GP_16 1
#define ALPHA_R_IMMED_GP_HI32 2
#define ALPHA_R_IMMED_SCN_HI32 3
#define ALPHA_R_IMMED_BR_HI32 4
#define ALPHA_R_IMMED_LO32 5
/********************** 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. */