global_imports_auto.hss 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. [Main]
  2. Title=Automatically Created Global Imports
  3. Index=__kernel_program_header, __kernel_library_header, __fargo_program_header, __fargo_library_header, __flash_os_header, __nostub_comment_header, __handle_constructors, __handle_destructors, __handle_bss, __initialize_bss, __handle_relocs, __handle_rom_calls, __handle_ram_calls, __handle_libraries, __handle_data_var, __data_var_create_copy, __data_var_copy_if_archived
  4. [Top]
  5. In addition to user-defined global imports, the TIGCC linker also defines
  6. some global imports of its own, whenever special code is needed to handle a
  7. situation:
  8. <BR><BR>
  9. <DL>
  10. <DT><B>__kernel_program_header</B>
  11. <DD>This global import is created automatically if the linker
  12. is operating in <A HREF="$$LINK(modes_kernel)">kernel mode</A>, and if the
  13. file is not declared as a library (see the
  14. <A HREF="$$LINK(control_library)">_library</A> control symbol).
  15. <BR><BR>
  16. <DT><B>__kernel_library_header</B>
  17. <DD>This global import is created automatically if the linker
  18. is operating in <A HREF="$$LINK(modes_kernel)">kernel mode</A>, and if the
  19. file is declared as a library (see the
  20. <A HREF="$$LINK(control_library)">_library</A> control symbol).
  21. <BR><BR>
  22. <DT><B>__fargo_program_header</B>
  23. <DD>This global import is created automatically if the linker
  24. is operating in <A HREF="$$LINK(modes_fargo)">Fargo II mode</A>, and if the
  25. file is not declared as a library (see the
  26. <A HREF="$$LINK(control_library)">_library</A> control symbol).
  27. <BR><BR>
  28. <DT><B>__fargo_library_header</B>
  29. <DD>This global import is created automatically if the linker
  30. is operating in <A HREF="$$LINK(modes_fargo)">Fargo II mode</A>, and if the
  31. file is declared as a library (see the
  32. <A HREF="$$LINK(control_library)">_library</A> control symbol).
  33. <BR><BR>
  34. <DT><B>__flash_os_header</B>
  35. <DD>This global import is created automatically if the linker
  36. is operating in <A HREF="$$LINK(modes_flash_os)">Flash OS mode</A>.
  37. <BR><BR>
  38. <DT><B>__nostub_comment_header</B>
  39. <DD>This global import is created automatically if NoStub data (comment) exports
  40. are defined for the program. The file reacting to this import must use
  41. <A HREF="$$LINK(symbols_ld_nostub_comment_count)">__ld_nostub_comment_count
  42. </A> and
  43. <A HREF="$$LINK(insert_nostub_comments)">__ld_insert_nostub_comments</A>
  44. to insert the actual data exports into the header.
  45. <BR><BR>
  46. <DT><B>__handle_constructors</B>
  47. <DD>This global import is created automatically if constructors
  48. are defined for the program. The file which handles this import must query
  49. the constructor section using the
  50. <A HREF="$$LINK(symbols_ld_constructors_start)">__ld_constructors_start</A>,
  51. <A HREF="$$LINK(symbols_ld_constructors_end)">__ld_constructors_end</A>,
  52. <A HREF="$$LINK(symbols_ld_constructors_size)">__ld_constructors_size</A>,
  53. and <A HREF="$$LINK(symbols_ld_constructor_count)">__ld_constructor_count</A>
  54. symbols.
  55. <BR><BR>
  56. <DT><B>__handle_destructors</B>
  57. <DD>This global import is created automatically if destructors
  58. are defined for the program. The file which handles this import must query
  59. the destructor section using the
  60. <A HREF="$$LINK(symbols_ld_destructors_start)">__ld_destructors_start</A>,
  61. <A HREF="$$LINK(symbols_ld_destructors_end)">__ld_destructors_end</A>,
  62. <A HREF="$$LINK(symbols_ld_destructors_size)">__ld_destructors_size</A>,
  63. and <A HREF="$$LINK(symbols_ld_destructor_count)">__ld_destructor_count</A>
  64. symbols.
  65. <BR><BR>
  66. <DT><B>__handle_bss</B>
  67. <DD>This global import is created automatically if the program
  68. contains a BSS section (a section containing uninitialized global variables).
  69. No file needs to react to this import; if the BSS section is not created at
  70. run time (using <A HREF="$$LINK(symbols_ld_bss_size)">__ld_bss_size</A>,
  71. <A HREF="$$LINK(symbols_ld_bss_ref_count)">__ld_bss_ref_count</A>, and
  72. an appropriate <A HREF="$$LINK(insert)">insertion</A> for the relocation), it
  73. is simply passed on to the output file. If the output format does not support
  74. sections, the BSS section is merged with the other sections. However, if the
  75. program reacts to this import, it absolutely <I>must</I> handle the
  76. relocation entries pointing into the BSS section.
  77. <BR><BR>
  78. <DT><B>__initialize_bss</B>
  79. <DD>This global import is created automatically if the program
  80. contains a BSS section, and the program requires the contents of this section
  81. to be initialized to zero. The file reacting to this import must use
  82. <A HREF="$$LINK(symbols_ld_bss_start)">__ld_bss_start</A>,
  83. <A HREF="$$LINK(symbols_ld_bss_end)">__ld_bss_end</A>, and
  84. <A HREF="$$LINK(symbols_ld_bss_size)">__ld_bss_size</A> to query the location
  85. and size of the BSS section.
  86. <BR><BR>
  87. <DT><B>__handle_relocs</B>
  88. <DD>This global import is created automatically if the program
  89. contains absolute relocation entries. If no file reacts to this import,
  90. relocation entries have to be handled by the output format. The file reacting
  91. to this import must use
  92. <A HREF="$$LINK(symbols_ld_reloc_count)">__ld_reloc_count</A> and an
  93. appropriate <A HREF="$$LINK(insert)">insertion</A> to get information about
  94. the necessary relocation.
  95. <BR><BR>
  96. <DT><B>__handle_rom_calls</B>
  97. <DD>This global import is created automatically if the program
  98. contains ROM calls. If no file reacts to this import, ROM calls are handled
  99. by the output format. The file reacting to this import must use
  100. <A HREF="$$LINK(symbols_ld_rom_call_count)">__ld_rom_call_count</A> and an
  101. appropriate <A HREF="$$LINK(insert)">insertion</A> to get information about
  102. the ROM calls.
  103. <BR><BR>
  104. <DT><B>__handle_ram_calls</B>
  105. <DD>This global import is created automatically if the program
  106. contains RAM calls. If no file reacts to this import, RAM calls are handled
  107. by the output format. The file reacting to this import must use
  108. <A HREF="$$LINK(symbols_ld_ram_call_count)">__ld_ram_call_count</A> and an
  109. appropriate <A HREF="$$LINK(insert)">insertion</A> to get information about
  110. the RAM calls.
  111. <BR><BR>
  112. <DT><B>__handle_libraries</B>
  113. <DD>This global import is created automatically if the program
  114. references at least one library. If no file reacts to this import, library
  115. calls are handled by the output format. The file reacting to this import must
  116. use <A HREF="$$LINK(symbols_ld_lib_count)">__ld_lib_count</A> and an
  117. appropriate <A HREF="$$LINK(insert)">insertion</A> to get information about
  118. the libraries.
  119. <BR><BR>
  120. <DT><B>__handle_data_var</B>
  121. <DD>This global import is created automatically if the data
  122. section of the program is not included in the program itself but in an
  123. external file. The file that handles this import must open this file and
  124. relocate the program accordingly. It must refer to
  125. <A HREF="$$LINK(symbols_ld_data_var_name_end)">__ld_data_var_name_end</A>,
  126. <A HREF="$$LINK(symbols_ld_data_size)">__ld_data_size</A>, and an appropriate
  127. <A HREF="$$LINK(insert)">insertion</A> for the relocation.
  128. <BR><BR>
  129. <DT><B>__data_var_create_copy</B>
  130. <DD>This global import is created automatically if the data
  131. section of the program is not included in the program itself but in an
  132. external file, and this file needs to be copied into memory (either always or
  133. under certain circumstances).
  134. <BR><BR>
  135. <DT><B>__data_var_copy_if_archived</B>
  136. <DD>This global import is created automatically if the data
  137. section of the program is not included in the program itself but in an
  138. external file, and this file needs to be copied into memory only if it is
  139. archived. This import is created only in combination with
  140. __data_var_create_copy.
  141. </DL>