insert_compressed_relocs.hss 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. [Main]
  2. Title=__ld_insert_compressed_relocs
  3. See Also=insert_compressed_bss_refs: __ld_insert_compressed_bss_refs, insert_compressed_data_refs: __ld_insert_compressed_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_compressed_rom_calls otherwise.
  8. [Top]
  9. __ld_insert_compressed_relocs inserts relocs in a compressed format known
  10. from Fargo. 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 end 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_compressed_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>If we are inside a nibble sequence (see below):
  24. <UL>
  25. <LI><B>1 nibble (1/2 byte):</B> <I>offset</I></LI>
  26. </UL></LI>
  27. <LI>Else: Any of the following, whichever fits:
  28. <UL>
  29. <LI><B>1 byte:</B> <I>offset</I> + 1 (must be between 0x01 and
  30. 0x7F)</LI>
  31. <LI><B>1 byte:</B>
  32. <UL>
  33. <LI>1<SUP>st</SUP> nibble: <I>nibble_count</I> / 2 + 0x6
  34. (must be between 0x8 and 0xB)</LI>
  35. <LI>2<SUP>nd</SUP> nibble: <I>offset</I></LI>
  36. </UL>
  37. A nibble sequence of <I>nibble_count</I> nibbles follows
  38. (see above).
  39. </LI>
  40. <LI><B>2 bytes:</B> <I>offset</I> + 0xBF81 (must be between 0xC000
  41. and 0xFFFE)</LI>
  42. <LI>A variable-length sequence:
  43. <UL>
  44. <LI><B>2 bytes:</B> 0xFFFF</LI>
  45. <LI>Any of the four possibilities, with <I>offset</I> decreased
  46. by 0x407E</LI>
  47. </UL>
  48. </LI>
  49. </UL></LI>
  50. </UL></LI>
  51. <LI><B>1 byte:</B> 0</LI>
  52. </UL>
  53. <B>Note:</B> The limitations of
  54. <A HREF="$$LINK(insert_kernel_relocs)">__ld_insert_kernel_relocs</A> also
  55. apply to this insertion.