#ifndef __reloc_h__
#define __reloc_h__

/*
********************************************************************************
*                         Copyright (c) 1985 AT&T                              *
*                           All Rights Reserved                                *
*                                                                              *
*                                                                              *
*          THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T                 *
*        The copyright notice above does not evidence any actual               *
*        or intended publication of such source code.                          *
********************************************************************************
*/
/*	@(#)reloc.h	2.1	*/

/*
 * @(#)reloc.h	1.3 (National Semiconductor) 1/12/88 17:12:52
 * @(#) copyrights and other release restrictions may apply
 */

/*
 *  static char ID[] = "inc/common/reloc.h: 1.3 12/29/82";
 */

struct reloc {
	long	r_vaddr;	/* (virtual) address of reference */
	long	r_symndx;	/* index into symbol table */
	unsigned short	r_type;		/* relocation type */
	short   dummy;		/* Dummy bytes for portability */
	};


/*
 *  GENIX environment for sys16 
 */

#define  R_ADDRTYPE    0x000f      /* type of relocation item               */
#define   R_NOTHING      0x0000    /* ignore                                */
#define   R_ADDRESS      0x0001    /* take address of symbol                */
#define   R_LINKENTRY    0x0002    /* take symbol's link entry index        */
#define   R_STATIC_SEC   0x0003    /* relocate relative to base address of  */
				   /* output .static section 		    */
#define   R_LINK_SEC     0x0004    /* relocate relative to base address of  */
				   /* output .link section 		    */
#define   R_TEXT_SEC     0x0005    /* relocate relative to base address of  */
				   /* output .text section 		    */

#define  R_RELTO       0x00f0      /* action to take when relocating        */
#define   R_ABS          0x0000    /* keep symbol's address as such         */
#define   R_PCREL        0x0010    /* subtract the pc address of hole       */
#define   R_SBREL        0x0020    /* subtract the static base start of this*/
				   /* section's module                      */
#define	  R_BIGENDIAN	 0x0080	   /* relocate entry in Big-Endian byte order*/

#define  R_FORMAT      0x0f00      /* relocation item data format           */
#define   R_NUMBER       0x0000    /* retain as two's complement value      */
#define   R_DISPL        0x0100    /* convert to NS16000 displacement       */
#define   R_PROCDES      0x0200    /* convert to NS16000 procedure descriptor*/
#define   R_IMMED        0X0300    /* for NS16000 immediate addressing mode */
#define	  R_SF_DISPL	 0x0400	   /* SF core displacement type		    */
#define	  R_SF_IMMED	 0x0500	   /* SF core immediate type		    */
#define	  R_SR_DISPL	 0x0600	   /* SR core displacement type		    */
#define	  R_SR_IMMED	 0x0700	   /* SR core immediate type		    */
#define   R_RESERVED     R_SF_DISPL    /* For compatibility.		    */
#define   R_RESERVED1    R_SF_IMMED    /* For compatibility.		    */

#define  R_SIZESP      0xf000      /* relocation item size                  */
#define   R_S_08         0x0000    /* relocate 8 bits                       */
#define   R_S_16         0x1000    /* relocate 16 bits                      */
#define   R_S_32         0x2000    /* relocate 32 bits                      */
#define   R_S_11         0x3000    /* relocate 11 bits                      */
#define   R_S_19         0x4000    /* relocate 19 bits                      */


/* Musking for the relocated holes */

#define   R_HBYTE       0x00       /* relocated filed is one byte           */
#define   R_HWORD       0x8000     /* relocated field is one word           */
#define   R_HLONG       0xc0000000 /* relocated field is long              */

 
 /*
  * DEC Processors  VAX 11/780 and VAX 11/750 
  *
  */
 
#define R_RELBYTE	017
#define R_RELWORD	020
#define R_RELLONG	021
#define R_PCRBYTE	022
#define R_PCRWORD	023
#define R_PCRLONG	024


#define	RELOC	struct reloc
#define	RELSZ	10	/* sizeof(RELOC) */

/* CAUTION !!! RELSZ is NOT sizeof(RELOC), but it is a correct size.	*/
/* The "dummy" field of the structure is NOT written into coff file.	*/
/* 					Vit. 30/5/89			*/

	/* Definition of a "TV" relocation type */

#endif /* __reloc_h__ */
