home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 38.ddi / root.3 / usr / include / reloc.h / reloc.h
Encoding:
C/C++ Source or Header  |  1990-10-02  |  2.6 KB  |  127 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1988 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ident    "@(#)/usr/include/reloc.h.sl 1.2 5.0 08/27/90 52897 AT&T-USO 1.3"
  11.  
  12. #ifndef _RELOC_H
  13. #define _RELOC_H
  14.  
  15. struct reloc {
  16.     long    r_vaddr;    /* (virtual) address of reference */
  17.     long    r_symndx;    /* index into symbol table */
  18.     unsigned short    r_type;        /* relocation type */
  19.     };
  20.  
  21. /*
  22.  *   relocation types for all products and generics
  23.  */
  24.  
  25. /*
  26.  * All generics
  27.  *    reloc. already performed to symbol in the same section
  28.  */
  29. #define  R_ABS        0
  30.  
  31. /*
  32.  * X86 generic
  33.  *    8-bit offset reference in 8-bits
  34.  *    8-bit offset reference in 16-bits 
  35.  *    12-bit segment reference
  36.  *    auxiliary relocation entry
  37.  */
  38. #define    R_OFF8        07
  39. #define R_OFF16        010
  40. #define    R_SEG12        011
  41. #define    R_AUX        013
  42.  
  43. /*
  44.  * B16 and X86 generics
  45.  *    16-bit direct reference
  46.  *    16-bit "relative" reference
  47.  *    16-bit "indirect" (TV) reference
  48.  */
  49. #define  R_DIR16    01
  50. #define  R_REL16    02
  51. #define  R_IND16    03
  52.  
  53. /*
  54.  * 3B generic
  55.  *    24-bit direct reference
  56.  *    24-bit "relative" reference
  57.  *    16-bit optimized "indirect" TV reference
  58.  *    24-bit "indirect" TV reference
  59.  *    32-bit "indirect" TV reference
  60.  */
  61. #define  R_DIR24    04
  62. #define  R_REL24    05
  63. #define  R_OPT16    014
  64. #define  R_IND24    015
  65. #define  R_IND32    016
  66.  
  67. /*
  68.  * 3B and M32 || u3b15 || u3b5 || u3b2 generics
  69.  *    32-bit direct reference
  70.  */
  71. #define  R_DIR32    06
  72.  
  73. /*
  74.  * M32 || u3b15 || u3b5 || u3b2 generic
  75.  *    32-bit direct reference with bytes swapped
  76.  */
  77. #define  R_DIR32S    012
  78.  
  79. /*
  80.  * DEC Processors  VAX 11/780 and VAX 11/750
  81.  *
  82.  */
  83.  
  84. #define R_RELBYTE    017
  85. #define R_RELWORD    020
  86. #define R_RELLONG    021
  87. #define R_PCRBYTE    022
  88. #define R_PCRWORD    023
  89. #define R_PCRLONG    024
  90.  
  91. /*
  92.  * Motorola 68000
  93.  *
  94.  * ... uses R_RELBYTE, R_RELWORD, R_RELLONG, R_PCRBYTE and R_PCRWORD as for
  95.  * DEC machines above.
  96.  */
  97.  
  98. #define    RELOC    struct reloc
  99. #define    RELSZ    10    /* sizeof(RELOC) */
  100.  
  101.     /* Definition of a "TV" relocation type */
  102.  
  103. #if defined(__STDC__)
  104.  
  105. #if #machine(N3B)
  106. #define ISTVRELOC(x)    ((x==R_OPT16)||(x==R_IND24)||(x==R_IND32))
  107. #elif #machine(B16) || #machine(X86)
  108. #define ISTVRELOC(x)    (x==R_IND16)
  109. #else
  110. #define ISTVRELOC(x)    (x!=x)    /* never the case */
  111. #endif
  112.  
  113. #else
  114. #if N3B
  115. #define ISTVRELOC(x)    ((x==R_OPT16)||(x==R_IND24)||(x==R_IND32))
  116. #endif
  117. #if B16 || X86
  118. #define ISTVRELOC(x)    (x==R_IND16)
  119. #endif
  120. #if M32 || u3b15 || u3b5 || u3b2
  121. #define ISTVRELOC(x)    (x!=x)    /* never the case */
  122. #endif
  123.  
  124. #endif     /* __STDC__ */
  125.  
  126. #endif     /* _RELOC_H */
  127.