insert_mlink_relocs.hss 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. [Main]
  2. Title=__ld_insert_mlink_relocs
  3. See Also=insert_mlink_bss_refs: __ld_insert_mlink_bss_refs, insert_mlink_data_refs: __ld_insert_mlink_data_refs, insert_kernel_relocs: __ld_insert_kernel_relocs
  4. [Developer Notes]
  5. Warning: This table is referred to in other places. Please don't change the
  6. definition of "offset" if you don't know what you are doing. You'll risk
  7. breaking the definition of __ld_insert_mlink_rom_calls otherwise.
  8. [Top]
  9. __ld_insert_mlink_relocs inserts relocs in a compressed format known
  10. from mlink. For more information on inserting and processing relocs, see
  11. <A HREF="$$LINK(insert_kernel_relocs)">__ld_insert_kernel_relocs</A>.
  12. <BR><BR>
  13. In the following format description, <I>offset</I> refers to the difference
  14. in words (half of the difference in bytes) between the start of this reloc
  15. and the start of the previous reloc. If there is no previous reloc (i.e. for
  16. the first reloc), <I>offset</I> is the distance in words between this reloc
  17. and the symbol <CODE>__ld_mlink_relocs_ref</CODE>. This symbol must be
  18. exported to be found. If it is not found, the entry point is used instead
  19. (see <A HREF="$$LINK(symbols_ld_entry_point)">__ld_entry_point</A>).
  20. <UL>
  21. <LI>For each relocation entry...
  22. <UL>
  23. <LI>Any of the following, whichever fits:
  24. <UL>
  25. <LI>For 0 &lt;= <I>offset</I> &lt; 128: <B>1 byte:</B>
  26. 0x80 + <I>offset</I></LI>
  27. <LI>For 128 &lt;= <I>offset</I> &lt; 16384: <B>2 bytes:</B>
  28. <I>offset</I> / 128, 0x80 + (<I>offset</I> % 128)</LI>
  29. <LI>For 16384 &lt;= <I>offset</I> &lt; 2097152: <B>3 bytes:</B>
  30. <I>offset</I> / 16384, (<I>offset</I> % 16384) / 128,
  31. 0x80 + (<I>offset</I> % 128)</LI>
  32. <LI>Anything higher isn't interesting for us because of the 64 KB
  33. file size limit.</LI>
  34. </UL></LI>
  35. </UL></LI>
  36. <LI><B>1 byte:</B> 0</LI>
  37. </UL>
  38. <B>Note:</B> The limitations of
  39. <A HREF="$$LINK(insert_kernel_relocs)">__ld_insert_kernel_relocs</A> also
  40. apply to this insertion.