home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / GDB / GDB-4.13 / GDB-4 / gdb-4.13 / include / elf / mips.h < prev   
Encoding:
C/C++ Source or Header  |  1994-05-24  |  8.0 KB  |  258 lines

  1. /* MIPS ELF support for BFD.
  2.    Copyright (C) 1993, 1994 Free Software Foundation, Inc.
  3.  
  4.    By Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>, from
  5.    information in the System V Application Binary Interface, MIPS
  6.    Processor Supplement.
  7.  
  8. This file is part of BFD, the Binary File Descriptor library.
  9.  
  10. This program is free software; you can redistribute it and/or modify
  11. it under the terms of the GNU General Public License as published by
  12. the Free Software Foundation; either version 2 of the License, or
  13. (at your option) any later version.
  14.  
  15. This program is distributed in the hope that it will be useful,
  16. but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. GNU General Public License for more details.
  19.  
  20. You should have received a copy of the GNU General Public License
  21. along with this program; if not, write to the Free Software
  22. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  23.  
  24. /* This file holds definitions specific to the MIPS ELF ABI.  Note
  25.    that most of this is not actually implemented by BFD.  */
  26.  
  27. /* Processor specific flags for the ELF header e_flags field.  */
  28.  
  29. /* At least one .noreorder directive appears in the source.  */
  30. #define EF_MIPS_NOREORDER    0x00000001
  31.  
  32. /* File contains position independent code.  */
  33. #define EF_MIPS_PIC        0x00000002
  34.  
  35. /* Code in file uses the standard calling sequence for calling
  36.    position independent code.  */
  37. #define EF_MIPS_CPIC        0x00000004
  38.  
  39. /* Four bit MIPS architecture field.  */
  40. #define EF_MIPS_ARCH        0xf0000000
  41.  
  42. /* -mips1 code.  */
  43. #define E_MIPS_ARCH_1        0x00000000
  44.  
  45. /* -mips2 code.  */
  46. #define E_MIPS_ARCH_2        0x10000000
  47.  
  48. /* -mips3 code.  */
  49. #define E_MIPS_ARCH_3        0x20000000
  50.  
  51. /* Processor specific section indices.  These sections do not actually
  52.    exist.  Symbols with a st_shndx field corresponding to one of these
  53.    values have a special meaning.  */
  54.  
  55. /* Defined and allocated common symbol.  Value is virtual address.  If
  56.    relocated, alignment must be preserved.  */
  57. #define SHN_MIPS_ACOMMON    0xff00
  58.  
  59. /* Defined and allocated text symbol.  Value is virtual address.
  60.    Occur in the dynamic symbol table of Alpha OSF/1 and Irix 5 executables.  */
  61. #define SHN_MIPS_TEXT        0xff01
  62.  
  63. /* Defined and allocated data symbol.  Value is virtual address.
  64.    Occur in the dynamic symbol table of Alpha OSF/1 and Irix 5 executables.  */
  65. #define SHN_MIPS_DATA        0xff02
  66.  
  67. /* Small common symbol.  */
  68. #define SHN_MIPS_SCOMMON    0xff03
  69.  
  70. /* Small undefined symbol.  */
  71. #define SHN_MIPS_SUNDEFINED    0xff04
  72.  
  73. /* Processor specific section types.  */
  74.  
  75. /* Section contains the set of dynamic shared objects used when
  76.    statically linking.  */
  77. #define SHT_MIPS_LIBLIST    0x70000000
  78.  
  79. /* Section contains list of symbols whose definitions conflict with
  80.    symbols defined in shared objects.  */
  81. #define SHT_MIPS_CONFLICT    0x70000002
  82.  
  83. /* Section contains the global pointer table.  */
  84. #define SHT_MIPS_GPTAB        0x70000003
  85.  
  86. /* Section contains microcode information.  The exact format is
  87.    unspecified.  */
  88. #define SHT_MIPS_UCODE        0x70000004
  89.  
  90. /* Section contains some sort of debugging information.  The exact
  91.    format is unspecified.  It's probably ECOFF symbols.  */
  92. #define SHT_MIPS_DEBUG        0x70000005
  93.  
  94. /* Section contains register usage information.  */
  95. #define SHT_MIPS_REGINFO    0x70000006
  96.  
  97. /* Section contains miscellaneous options (used on Irix).  */
  98. #define SHT_MIPS_OPTIONS    0x7000000d
  99.  
  100. /* A section of type SHT_MIPS_LIBLIST contains an array of the
  101.    following structure.  The sh_link field is the section index of the
  102.    string table.  The sh_info field is the number of entries in the
  103.    section.  */
  104. typedef struct
  105. {
  106.   /* String table index for name of shared object.  */
  107.   unsigned long l_name;
  108.   /* Time stamp.  */
  109.   unsigned long l_time_stamp;
  110.   /* Checksum of symbol names and common sizes.  */
  111.   unsigned long l_checksum;
  112.   /* String table index for version.  */
  113.   unsigned long l_version;
  114.   /* Flags.  */
  115.   unsigned long l_flags;
  116. } Elf32_Lib;
  117.  
  118. /* The l_flags field of an Elf32_Lib structure may contain the
  119.    following flags.  */
  120.  
  121. /* Require an exact match at runtime.  */
  122. #define LL_EXACT_MATCH        0x00000001
  123.  
  124. /* Ignore version incompatibilities at runtime.  */
  125. #define LL_IGNORE_INT_VER    0x00000002
  126.  
  127. /* A section of type SHT_MIPS_CONFLICT is an array of indices into the
  128.    .dynsym section.  Each element has the following type.  */
  129. typedef unsigned long Elf32_Conflict;
  130.  
  131. /* A section of type SHT_MIPS_GPTAB contains information about how
  132.    much GP space would be required for different -G arguments.  This
  133.    information is only used so that the linker can provide informative
  134.    suggestions as to the best -G value to use.  The sh_info field is
  135.    the index of the section for which this information applies.  The
  136.    contents of the section are an array of the following union.  The
  137.    first element uses the gt_header field.  The remaining elements use
  138.    the gt_entry field.  */
  139. typedef union
  140. {
  141.   struct
  142.     {
  143.       /* -G value actually used for this object file.  */
  144.       unsigned long gt_current_g_value;
  145.       /* Unused.  */
  146.       unsigned long gt_unused;
  147.     } gt_header;
  148.   struct
  149.     {
  150.       /* If this -G argument has been used...  */
  151.       unsigned long gt_g_value;
  152.       /* ...this many GP section bytes would be required.  */
  153.       unsigned long gt_bytes;
  154.     } gt_entry;
  155. } Elf32_gptab;
  156.  
  157. /* The external version of Elf32_gptab.  */
  158.  
  159. typedef union
  160. {
  161.   struct
  162.     {
  163.       unsigned char gt_current_g_value[4];
  164.       unsigned char gt_unused[4];
  165.     } gt_header;
  166.   struct
  167.     {
  168.       unsigned char gt_g_value[4];
  169.       unsigned char gt_bytes[4];
  170.     } gt_entry;
  171. } Elf32_External_gptab;
  172.  
  173. /* A section of type SHT_MIPS_REGINFO contains the following
  174.    structure.  */
  175. typedef struct
  176. {
  177.   /* Mask of general purpose registers used.  */
  178.   unsigned long ri_gprmask;
  179.   /* Mask of co-processor registers used.  */
  180.   unsigned long ri_cprmask[4];
  181.   /* GP register value for this object file.  */
  182.   long ri_gp_value;
  183. } Elf32_RegInfo;
  184.  
  185. /* The external version of the Elf_RegInfo structure.  */
  186. typedef struct
  187. {
  188.   unsigned char ri_gprmask[4];
  189.   unsigned char ri_cprmask[4][4];
  190.   unsigned char ri_gp_value[4];
  191. } Elf32_External_RegInfo;
  192.  
  193. /* MIPS ELF .reginfo swapping routines.  */
  194. extern void bfd_mips_elf32_swap_reginfo_in
  195.   PARAMS ((bfd *, const Elf32_External_RegInfo *, Elf32_RegInfo *));
  196. extern void bfd_mips_elf32_swap_reginfo_out
  197.   PARAMS ((bfd *, const Elf32_RegInfo *, Elf32_External_RegInfo *));
  198.  
  199. /* Processor specific section flags.  */
  200.  
  201. /* This section must be in the global data area.  */
  202. #define SHF_MIPS_GPREL        0x10000000
  203.  
  204. /* Processor specific program header types.  */
  205.  
  206. /* Register usage information.  Identifies one .reginfo section.  */
  207. #define PT_MIPS_REGINFO        0x70000000
  208.  
  209. /* Processor specific dynamic array tags.  */
  210.  
  211. /* 32 bit version number for runtime linker interface.  */
  212. #define DT_MIPS_RLD_VERSION    0x70000001
  213.  
  214. /* Time stamp.  */
  215. #define DT_MIPS_TIME_STAMP    0x70000002
  216.  
  217. /* Checksum of external strings and common sizes.  */
  218. #define DT_MIPS_ICHECKSUM    0x70000003
  219.  
  220. /* Index of version string in string table.  */
  221. #define DT_MIPS_IVERSION    0x70000004
  222.  
  223. /* 32 bits of flags.  */
  224. #define DT_MIPS_FLAGS        0x70000005
  225.  
  226. /* Base address of the segment.  */
  227. #define DT_MIPS_BASE_ADDRESS    0x70000006
  228.  
  229. /* Address of .conflict section.  */
  230. #define DT_MIPS_CONFLICT    0x70000008
  231.  
  232. /* Address of .liblist section.  */
  233. #define DT_MIPS_LIBLIST        0x70000009
  234.  
  235. /* Number of local global offset table entries.  */
  236. #define DT_MIPS_LOCAL_GOTNO    0x7000000a
  237.  
  238. /* Number of entries in the .conflict section.  */
  239. #define DT_MIPS_CONFLICTNO    0x7000000b
  240.  
  241. /* Number of entries in the .liblist section.  */
  242. #define DT_MIPS_LIBLISTNO    0x70000010
  243.  
  244. /* Number of entries in the .dynsym section.  */
  245. #define DT_MIPS_SYMTABNO    0x70000011
  246.  
  247. /* Index of first external dynamic symbol not referenced locally.  */
  248. #define DT_MIPS_UNREFEXTNO    0x70000012
  249.  
  250. /* Index of first dynamic symbol in global offset table.  */
  251. #define DT_MIPS_GOTSYM        0x70000013
  252.  
  253. /* Number of page table entries in global offset table.  */
  254. #define DT_MIPS_HIPAGENO    0x70000014
  255.  
  256. /* Address of run time loader map, used for debugging.  */
  257. #define DT_MIPS_RLD_MAP        0x70000016
  258.