[Main] Title=__ld_insert_preos_compressed_tables See Also=insert_compressed_relocs: __ld_insert_compressed_relocs, insert_compressed_rom_calls: __ld_insert_compressed_rom_calls, insert_kernel_ram_calls: __ld_insert_kernel_ram_calls, insert_compressed_bss_refs: __ld_insert_compressed_bss_refs [Top] __ld_insert_preos_compressed_tables is the most complex of the automatic insertions. It inserts all relocation-related tables in the compressed format expected by PreOs 0.68 or higher. PreOs expects those tables to be pointed to by the same pointer, so they need to be inserted all at once. The reference address expected by PreOs is the same for all relocation tables: 36 (0x24). It is defined as the end address of the smallest possible header/stub combination. (However, the smallest possible stub is not usable in practice because it does not emit any error messages. Therefore, the address does not correspond to any actual address in TIGCCLIB, so it is hard-coded in the linker.) The tables it inserts are, in order: PreOs uses a special format for the indices. It is not the same as for the relocation table. Instead, a PreOs index is encoded using one of the following formats: where index is the actual index, and offset is index + 1 for the first index and the difference between index and the previous index for the following ones.

Note: Since parts of this insertion are dealing with relocs, the limitations of __ld_insert_kernel_relocs also apply to this insertion.