[Main] Title=__ld_insert_kernel_relocs See Also=insert_kernel_bss_refs: __ld_insert_kernel_bss_refs, insert_kernel_data_refs: __ld_insert_kernel_data_refs, insert_mlink_relocs: __ld_insert_mlink_relocs, insert_compressed_relocs: __ld_insert_compressed_relocs [Top] Relocation entries indicate that the program needs to know some addresses which are only available at run time. In this case, the addresses referred to are locations inside the program code or data. Usually, all references to absolute addresses inside the program are inserted into the section if one of these two insertions is used; however, sections may be marked as being handled in another way, which prevents relocation entries to them from being output in this way. The data section is automatically marked as handled if it is externalized; the BSS section is marked as handled by referencing __ld_kernel_bss_table, by using __ld_insert_kernel_bss_refs before inserting the relocation entries, or by reacting to the __handle_bss global import.

__ld_insert_kernel_relocs uses the kernel format for storing relocation entries, which is used by kernels on the TI-89, TI-92 Plus, and V200, and by Fargo v0.2.0: If a program uses this insertion, it must process it as follows: Before program termination, this process has to be reverted, so that it can be repeated the next time the program starts. Since programs may be moved in memory while they are not executed, they may not simply deactivate the relocation code. This would also prevent programs from being transferred between devices.

Note: Relocation entries may only be inserted at a single place in the program. The reason for this is that the linker may have to add new relocation entries after they have been written into the section. Instead of keeping track of which entries have already been processed, we thought it would be easier to remove them once they have been written into a section. Also, it is dangerous to use this insertion from anything other than a startup section.