comprrlc.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* comprrlc.h: Routines for compressed relocation tables
  2. Copyright (C) 2003-2005 Kevin Kofler
  3. Portions copyright (C) 2002-2003 Sebastian Reichelt
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software Foundation,
  14. Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  15. #ifndef INSERT_COMPRRLC_H
  16. #define INSERT_COMPRRLC_H
  17. #include "../generic.h"
  18. #include "ins_def.h"
  19. #include "../data.h"
  20. #include "model/list.h"
  21. // Append relocation entries in the format required by the TIGCCLIB relocation
  22. // code. If TargetSection is NULL, append all relocation entries that point to
  23. // unhandled sections. Otherwise, append all relocation entries pointing to this
  24. // section.
  25. // Warning: Inserting relocs is special: Since the relocs are changed
  26. // during the process, they can be inserted only once.
  27. BOOLEAN InsertCompressedRelocs (SECTION *Section, SECTION *TargetSection, SECTION *MergedSection, const LOCATION *Reference);
  28. // Append relocation entries in the format required by the TIGCCLIB relocation
  29. // code, using InsertCompressedRelocs. If TargetSection is NULL, output an empty
  30. // relocation table. Otherwise, append all relocation entries pointing to this
  31. // section.
  32. // Warning: Inserting relocs is special: Since the relocs are changed
  33. // during the process, they can be inserted only once.
  34. BOOLEAN InsertCompressedSectionRefs (SECTION *Section, SECTION *TargetSection, SECTION *MergedSection, const LOCATION *Reference);
  35. // Append ROM calls in the format required by the TIGCCLIB relocation code.
  36. BOOLEAN InsertCompressedROMCalls (SECTION *Section, SECTION *MergedSection, const LOCATION *Reference);
  37. // Append the section size and relocs to the specified section in the
  38. // format required by PreOS.
  39. // Warning: Inserting relocs is special: Since the relocs are changed
  40. // during the process, they can be inserted only once.
  41. BOOLEAN InsertPreOSSectionRefs (SECTION *Section, SECTION *TargetSection, SECTION *MergedSection, const LOCATION *Reference);
  42. // Append ROM calls in the format required by PreOs.
  43. BOOLEAN InsertPreOsROMCalls (SECTION *Section, SECTION *MergedSection, const LOCATION *Reference);
  44. // Append RAM calls in the format required by PreOs.
  45. BOOLEAN InsertPreOsRAMCalls (SECTION *Section, SECTION *MergedSection, const LOCATION *Reference);
  46. // Append libraries and library calls in the format required by PreOs.
  47. BOOLEAN InsertPreOsLibraries (SECTION *Section, SECTION *MergedSection, const LOCATION *Reference);
  48. // Append import tables and relocation entries in the format required by PreOs.
  49. // In order: library imports, ROM calls, RAM calls, relocs, BSS references. All
  50. // in one stream, pointed to by a single pointer.
  51. // Warning: Inserting relocs is special: Since the relocs are changed
  52. // during the process, they can be inserted only once.
  53. BOOLEAN InsertPreOsCompressedTables (SECTION *Section);
  54. #ifdef FARGO_SUPPORT
  55. // Append the section size and section relocation entries in the format
  56. // required by Fargo 0.2.1.
  57. // Warning: Inserting relocs is special: Since the relocs are changed
  58. // during the process, they can be inserted only once.
  59. BOOLEAN InsertFargo021SectionRefs (SECTION *Section, SECTION *TargetSection, SECTION *MergedSection, const LOCATION *Reference);
  60. // Append library calls in the format required by Fargo 0.2.1.
  61. BOOLEAN InsertFargo021Libraries (SECTION *Section, SECTION *MergedSection, const LOCATION *Reference);
  62. #endif /* FARGO_SUPPORT */
  63. // Append mlink-style relocation entries in the format required by the TIGCCLIB
  64. // relocation code. If TargetSection is NULL, append all relocation entries that
  65. // point to unhandled sections. Otherwise, append all relocation entries
  66. // pointing to this section.
  67. // Warning: Inserting relocs is special: Since the relocs are changed
  68. // during the process, they can be inserted only once.
  69. BOOLEAN InsertMlinkRelocs (SECTION *Section, SECTION *TargetSection, SECTION *MergedSection, const LOCATION *Reference);
  70. // Append mlink-style relocation entries in the format required by the TIGCCLIB
  71. // relocation code, using InsertMlinkRelocs. If TargetSection is NULL, output
  72. // an empty relocation table. Otherwise, append all relocation entries pointing
  73. // to this section.
  74. // Warning: Inserting relocs is special: Since the relocs are changed
  75. // during the process, they can be inserted only once.
  76. BOOLEAN InsertMlinkSectionRefs (SECTION *Section, SECTION *TargetSection, SECTION *MergedSection, const LOCATION *Reference);
  77. // Append ROM calls in the mlink-style format required by the TIGCCLIB
  78. // relocation code.
  79. BOOLEAN InsertMlinkROMCalls (SECTION *Section, SECTION *MergedSection, const LOCATION *Reference);
  80. #endif