| __ld_insert_mlink_relocs

Previous | Automatically Inserted Section Contents | Next

__ld_insert_mlink_relocs inserts relocs in a compressed format known from mlink. For more information on inserting and processing relocs, see __ld_insert_kernel_relocs.
In the following format description, offset refers to the difference in words (half of the difference in bytes) between the start of this reloc and the start of the previous reloc. If there is no previous reloc (i.e. for the first reloc), offset is the distance in words between this reloc and the symbol `__ld_mlink_relocs_ref`. This symbol must be exported to be found. If it is not found, the entry point is used instead (see __ld_entry_point).

- For each relocation entry...
  - Any of the following, whichever fits:
    - For 0 <= offset < 128: 1 byte: 0x80 + offset
    - For 128 <= offset < 16384: 2 bytes: offset / 128, 0x80 + (offset % 128)
    - For 16384 <= offset < 2097152: 3 bytes: offset / 16384, (offset % 16384) / 128, 0x80 + (offset % 128)
    - Anything higher isn't interesting for us because of the 64 KB file size limit.
- 1 byte: 0

Note: The limitations of __ld_insert_kernel_relocs also apply to this insertion.

See also: __ld_insert_mlink_bss_refs, __ld_insert_mlink_data_refs, __ld_insert_kernel_relocs