[Main] Title=Automatically Created Global Imports 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 [Top] In addition to user-defined global imports, the TIGCC linker also defines some global imports of its own, whenever special code is needed to handle a situation:

__kernel_program_header
This global import is created automatically if the linker is operating in kernel mode, and if the file is not declared as a library (see the _library control symbol).

__kernel_library_header
This global import is created automatically if the linker is operating in kernel mode, and if the file is declared as a library (see the _library control symbol).

__fargo_program_header
This global import is created automatically if the linker is operating in Fargo II mode, and if the file is not declared as a library (see the _library control symbol).

__fargo_library_header
This global import is created automatically if the linker is operating in Fargo II mode, and if the file is declared as a library (see the _library control symbol).

__flash_os_header
This global import is created automatically if the linker is operating in Flash OS mode.

__nostub_comment_header
This global import is created automatically if NoStub data (comment) exports are defined for the program. The file reacting to this import must use __ld_nostub_comment_count and __ld_insert_nostub_comments to insert the actual data exports into the header.

__handle_constructors
This global import is created automatically if constructors are defined for the program. The file which handles this import must query the constructor section using the __ld_constructors_start, __ld_constructors_end, __ld_constructors_size, and __ld_constructor_count symbols.

__handle_destructors
This global import is created automatically if destructors are defined for the program. The file which handles this import must query the destructor section using the __ld_destructors_start, __ld_destructors_end, __ld_destructors_size, and __ld_destructor_count symbols.

__handle_bss
This global import is created automatically if the program contains a BSS section (a section containing uninitialized global variables). No file needs to react to this import; if the BSS section is not created at run time (using __ld_bss_size, __ld_bss_ref_count, and an appropriate insertion for the relocation), it is simply passed on to the output file. If the output format does not support sections, the BSS section is merged with the other sections. However, if the program reacts to this import, it absolutely must handle the relocation entries pointing into the BSS section.

__initialize_bss
This global import is created automatically if the program contains a BSS section, and the program requires the contents of this section to be initialized to zero. The file reacting to this import must use __ld_bss_start, __ld_bss_end, and __ld_bss_size to query the location and size of the BSS section.

__handle_relocs
This global import is created automatically if the program contains absolute relocation entries. If no file reacts to this import, relocation entries have to be handled by the output format. The file reacting to this import must use __ld_reloc_count and an appropriate insertion to get information about the necessary relocation.

__handle_rom_calls
This global import is created automatically if the program contains ROM calls. If no file reacts to this import, ROM calls are handled by the output format. The file reacting to this import must use __ld_rom_call_count and an appropriate insertion to get information about the ROM calls.

__handle_ram_calls
This global import is created automatically if the program contains RAM calls. If no file reacts to this import, RAM calls are handled by the output format. The file reacting to this import must use __ld_ram_call_count and an appropriate insertion to get information about the RAM calls.

__handle_libraries
This global import is created automatically if the program references at least one library. If no file reacts to this import, library calls are handled by the output format. The file reacting to this import must use __ld_lib_count and an appropriate insertion to get information about the libraries.

__handle_data_var
This global import is created automatically if the data section of the program is not included in the program itself but in an external file. The file that handles this import must open this file and relocate the program accordingly. It must refer to __ld_data_var_name_end, __ld_data_size, and an appropriate insertion for the relocation.

__data_var_create_copy
This global import is created automatically if the data section of the program is not included in the program itself but in an external file, and this file needs to be copied into memory (either always or under certain circumstances).

__data_var_copy_if_archived
This global import is created automatically if the data section of the program is not included in the program itself but in an external file, and this file needs to be copied into memory only if it is archived. This import is created only in combination with __data_var_create_copy.