internal.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. /* SOM internal definitions for BFD.
  2. Copyright (C) 2010-2022 Free Software Foundation, Inc.
  3. Contributed by Tristan Gingold <gingold@adacore.com>, AdaCore.
  4. This file is part of BFD, the Binary File Descriptor library.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software Foundation,
  15. Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
  16. #ifndef _SOM_INTERNAL_H
  17. #define _SOM_INTERNAL_H
  18. struct som_clock
  19. {
  20. unsigned int secs;
  21. unsigned int nanosecs;
  22. };
  23. struct som_header
  24. {
  25. unsigned short system_id;
  26. unsigned short a_magic;
  27. unsigned int version_id;
  28. struct som_clock file_time;
  29. unsigned int entry_space;
  30. unsigned int entry_subspace;
  31. unsigned int entry_offset;
  32. unsigned int aux_header_location;
  33. unsigned int aux_header_size;
  34. unsigned int som_length;
  35. unsigned int presumed_dp;
  36. unsigned int space_location;
  37. unsigned int space_total;
  38. unsigned int subspace_location;
  39. unsigned int subspace_total;
  40. unsigned int loader_fixup_location;
  41. unsigned int loader_fixup_total;
  42. unsigned int space_strings_location;
  43. unsigned int space_strings_size;
  44. unsigned int init_array_location;
  45. unsigned int init_array_total;
  46. unsigned int compiler_location;
  47. unsigned int compiler_total;
  48. unsigned int symbol_location;
  49. unsigned int symbol_total;
  50. unsigned int fixup_request_location;
  51. unsigned int fixup_request_total;
  52. unsigned int symbol_strings_location;
  53. unsigned int symbol_strings_size;
  54. unsigned int unloadable_sp_location;
  55. unsigned int unloadable_sp_size;
  56. unsigned int checksum;
  57. };
  58. struct som_aux_id
  59. {
  60. unsigned int mandatory : 1;
  61. unsigned int copy : 1;
  62. unsigned int append : 1;
  63. unsigned int ignore : 1;
  64. unsigned int reserved : 12;
  65. /* Header type. */
  66. unsigned int type : 16;
  67. /* Length of the header in bytes, without the two word identifier. */
  68. unsigned int length;
  69. };
  70. /* Generic auxiliary string header. */
  71. struct som_string_auxhdr
  72. {
  73. struct som_aux_id header_id;
  74. /* Length of the string, without the NUL. */
  75. unsigned int string_length;
  76. /* The string. */
  77. char string[1];
  78. };
  79. struct som_name_pt
  80. {
  81. char *name;
  82. unsigned int strx;
  83. };
  84. struct som_compilation_unit
  85. {
  86. /* Source file that produced the SOM. */
  87. struct som_name_pt name;
  88. /* Name of the language used when creating this SOM. */
  89. struct som_name_pt language_name;
  90. /* Identificaton of the compiler. */
  91. struct som_name_pt product_id;
  92. /* Version id of the compiler. */
  93. struct som_name_pt version_id;
  94. unsigned int flags;
  95. struct som_clock compile_time;
  96. struct som_clock source_time;
  97. };
  98. struct som_exec_auxhdr
  99. {
  100. struct som_aux_id som_auxhdr;
  101. long exec_tsize;
  102. long exec_tmem;
  103. long exec_tfile;
  104. long exec_dsize;
  105. long exec_dmem;
  106. long exec_dfile;
  107. long exec_bsize;
  108. long exec_entry;
  109. long exec_flags;
  110. long exec_bfill;
  111. };
  112. struct som_space_dictionary_record
  113. {
  114. unsigned int name;
  115. unsigned int is_loadable : 1;
  116. unsigned int is_defined : 1;
  117. unsigned int is_private : 1;
  118. unsigned int has_intermediate_code : 1;
  119. unsigned int is_tspecific : 1;
  120. unsigned int reserved : 11;
  121. unsigned int sort_key : 8;
  122. unsigned int reserved2 : 8;
  123. int space_number;
  124. int subspace_index;
  125. unsigned int subspace_quantity;
  126. int loader_fix_index;
  127. unsigned int loader_fix_quantity;
  128. int init_pointer_index;
  129. unsigned int init_pointer_quantity;
  130. };
  131. struct som_subspace_dictionary_record
  132. {
  133. int space_index;
  134. unsigned int access_control_bits : 7;
  135. unsigned int memory_resident : 1;
  136. unsigned int dup_common : 1;
  137. unsigned int is_common : 1;
  138. unsigned int is_loadable : 1;
  139. unsigned int quadrant : 2;
  140. unsigned int initially_frozen : 1;
  141. unsigned int is_first : 1;
  142. unsigned int code_only : 1;
  143. unsigned int sort_key : 8;
  144. unsigned int replicate_init : 1;
  145. unsigned int continuation : 1;
  146. unsigned int is_tspecific : 1;
  147. unsigned int is_comdat : 1;
  148. unsigned int reserved : 4;
  149. int file_loc_init_value;
  150. unsigned int initialization_length;
  151. unsigned int subspace_start;
  152. unsigned int subspace_length;
  153. unsigned int reserved2 : 5;
  154. unsigned int alignment : 27;
  155. unsigned int name;
  156. int fixup_request_index;
  157. unsigned int fixup_request_quantity;
  158. };
  159. struct som_lst_header
  160. {
  161. unsigned short system_id;
  162. unsigned short a_magic;
  163. unsigned int version_id;
  164. struct som_clock file_time;
  165. unsigned int hash_loc;
  166. unsigned int hash_size;
  167. unsigned int module_count;
  168. unsigned int module_limit;
  169. unsigned int dir_loc;
  170. unsigned int export_loc;
  171. unsigned int export_count;
  172. unsigned int import_loc;
  173. unsigned int aux_loc;
  174. unsigned int aux_size;
  175. unsigned int string_loc;
  176. unsigned int string_size;
  177. unsigned int free_list;
  178. unsigned int file_end;
  179. unsigned int checksum;
  180. };
  181. #endif /* _SOM_INTERNAL_H */