Browse Source

Document mlink-format reloc insertions.

git-svn-id: file:///var/svn/tigccpp/trunk/tigcc/doc/System/Info/ld@174 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 19 years ago
parent
commit
f09b78a5b1

File diff suppressed because it is too large
+ 0 - 0
insert.hss


+ 1 - 1
insert_kernel_bss_refs.hss

@@ -1,6 +1,6 @@
 [Main]
 Title=__ld_insert_kernel_bss_refs
-See Also=insert_kernel_data_refs: __ld_insert_kernel_data_refs, insert_kernel_relocs: __ld_insert_kernel_relocs, insert_compressed_bss_refs: __ld_insert_compressed_bss_refs
+See Also=insert_kernel_data_refs: __ld_insert_kernel_data_refs, insert_kernel_relocs: __ld_insert_kernel_relocs, insert_mlink_bss_refs: __ld_insert_mlink_bss_refs, insert_compressed_bss_refs: __ld_insert_compressed_bss_refs
 
 [Top]
 __ld_insert_kernel_bss_refs outputs references to the BSS section in the

+ 1 - 1
insert_kernel_data_refs.hss

@@ -1,6 +1,6 @@
 [Main]
 Title=__ld_insert_kernel_data_refs
-See Also=insert_kernel_bss_refs: __ld_insert_kernel_bss_refs, insert_kernel_relocs: __ld_insert_kernel_relocs, insert_compressed_data_refs: __ld_insert_compressed_data_refs
+See Also=insert_kernel_bss_refs: __ld_insert_kernel_bss_refs, insert_kernel_relocs: __ld_insert_kernel_relocs, insert_mlink_data_refs: __ld_insert_mlink_data_refs, insert_compressed_data_refs: __ld_insert_compressed_data_refs
 
 [Top]
 __ld_insert_kernel_data_refs outputs references to the data section in the

+ 1 - 1
insert_kernel_relocs.hss

@@ -1,6 +1,6 @@
 [Main]
 Title=__ld_insert_kernel_relocs
-See Also=insert_kernel_bss_refs: __ld_insert_kernel_bss_refs, insert_kernel_data_refs: __ld_insert_kernel_data_refs, insert_compressed_relocs: __ld_insert_compressed_relocs
+See Also=insert_kernel_bss_refs: __ld_insert_kernel_bss_refs, insert_kernel_data_refs: __ld_insert_kernel_data_refs, insert_mlink_relocs: __ld_insert_mlink_relocs, insert_compressed_relocs: __ld_insert_compressed_relocs
 
 [Top]
 Relocation entries indicate that the program needs to know some addresses

+ 1 - 1
insert_kernel_rom_calls.hss

@@ -1,6 +1,6 @@
 [Main]
 Title=__ld_insert_kernel_rom_calls
-See Also=insert_compressed_rom_calls: __ld_insert_compressed_rom_calls
+See Also=insert_mlink_rom_calls: __ld_insert_mlink_rom_calls, insert_compressed_rom_calls: __ld_insert_compressed_rom_calls
 
 [Top]
 __ld_insert_kernel_rom_calls can be used to handle

+ 20 - 0
insert_mlink_bss_refs.hss

@@ -0,0 +1,20 @@
+[Main]
+Title=__ld_insert_mlink_bss_refs
+See Also=insert_mlink_data_refs: __ld_insert_mlink_data_refs, insert_mlink_relocs: __ld_insert_mlink_relocs, insert_kernel_bss_refs: __ld_insert_kernel_bss_refs
+
+[Top]
+__ld_insert_mlink_bss_refs inserts relocs in the format defined in
+<A HREF="$$LINK(insert_mlink_relocs)">__ld_insert_mlink_relocs</A>.
+The only differences are that the <I>relocation address</I> is not the entry
+point of the program but the beginning of the BSS section and that the
+reference symbol used if there is no previous reloc (i.e. for the first reloc)
+is <CODE>__ld_mlink_bss_refs_ref</CODE>.
+<BR><BR>
+If you insert these references, the linker assumes that the BSS section is
+handled by you; that is, you have to allocate it dynamically using
+<A HREF="$$LINK(symbols_ld_bss_size)">__ld_bss_size</A> and use a pointer to
+it as the <I>relocation address</I>.
+<BR><BR>
+<B>Note:</B> The limitations of
+<A HREF="$$LINK(insert_kernel_relocs)">__ld_insert_kernel_relocs</A> also
+apply to this insertion.

+ 20 - 0
insert_mlink_data_refs.hss

@@ -0,0 +1,20 @@
+[Main]
+Title=__ld_insert_mlink_data_refs
+See Also=insert_mlink_bss_refs: __ld_insert_mlink_bss_refs, insert_mlink_relocs: __ld_insert_mlink_relocs, insert_kernel_data_refs: __ld_insert_kernel_data_refs
+
+[Top]
+__ld_insert_mlink_data_refs outputs references to the data section in the
+format defined in
+<A HREF="$$LINK(insert_mlink_relocs)">__ld_insert_mlink_relocs</A>.
+The only differences are that the <I>relocation address</I> is not the entry
+point of the program but the beginning of the data section and that the
+reference symbol used if there is no previous reloc (i.e. for the first reloc)
+is <CODE>__ld_mlink_data_refs_ref</CODE>.
+<BR><BR>
+If you read the data from an external variable (see
+<A HREF="$$LINK(global_imports_auto)">__handle_data_var</A>), you have to use
+the address of the variable (or a copy) as the <I>relocation address</I>.
+<BR><BR>
+<B>Note:</B> The limitations of
+<A HREF="$$LINK(insert_kernel_relocs)">__ld_insert_kernel_relocs</A> also
+apply to this insertion.

+ 42 - 0
insert_mlink_relocs.hss

@@ -0,0 +1,42 @@
+[Main]
+Title=__ld_insert_mlink_relocs
+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
+
+[Developer Notes]
+Warning: This table is referred to in other places. Please don't change the
+definition of "offset" if you don't know what you are doing. You'll risk
+breaking the definition of __ld_insert_mlink_rom_calls otherwise.
+
+[Top]
+__ld_insert_mlink_relocs inserts relocs in a compressed format known
+from mlink. For more information on inserting and processing relocs, see
+<A HREF="$$LINK(insert_kernel_relocs)">__ld_insert_kernel_relocs</A>.
+<BR><BR>
+In the following format description, <I>offset</I> 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), <I>offset</I> is the distance in words between this reloc
+and the symbol <CODE>__ld_mlink_relocs_ref</CODE>. This symbol must be
+exported to be found. If it is not found, the entry point is used instead
+(see <A HREF="$$LINK(symbols_ld_entry_point)">__ld_entry_point</A>).
+<UL>
+<LI>For each relocation entry...
+    <UL>
+    <LI>Any of the following, whichever fits:
+        <UL>
+        <LI>For 0 &lt;= <I>offset</I> &lt; 128: <B>1 byte:</B>
+            0x80 + <I>offset</I></LI>
+        <LI>For 128 &lt;= <I>offset</I> &lt; 16384: <B>2 bytes:</B>
+            <I>offset</I> / 128, 0x80 + (<I>offset</I> % 128)</LI>
+        <LI>For 16384 &lt;= <I>offset</I> &lt; 2097152: <B>3 bytes:</B>
+            <I>offset</I> / 16384, (<I>offset</I> % 16384) / 128,
+            0x80 + (<I>offset</I> % 128)</LI>
+        <LI>Anything higher isn't interesting for us because of the 64 KB
+            file size limit.</LI>
+        </UL></LI>
+    </UL></LI>
+<LI><B>1 byte:</B> 0</LI>
+</UL>
+<B>Note:</B> The limitations of
+<A HREF="$$LINK(insert_kernel_relocs)">__ld_insert_kernel_relocs</A> also
+apply to this insertion.

+ 31 - 0
insert_mlink_rom_calls.hss

@@ -0,0 +1,31 @@
+[Main]
+Title=__ld_insert_mlink_rom_calls
+See Also=insert_kernel_rom_calls: __ld_insert_kernel_rom_calls
+
+[Top]
+__ld_insert_mlink_rom_calls can be used to handle
+<A HREF="$$LINK(symbols_rom_call)">ROM calls</A>. It inserts references to
+ROM calls in a compressed format known from mlink but specifically altered for
+TIGCC:
+<UL>
+<LI>If the program uses at least one ROM call...
+    <UL>
+    <LI>For each ROM call...
+        <UL>
+        <LI>Mlink-type <I>index</I> of the ROM call. The index is encoded as
+            in <A HREF="$$LINK(insert_mlink_relocs)">__ld_insert_mlink_relocs</A>,
+            with <I>offset</I> being the index of the ROM call for the first
+            entry, and the difference of the index of this ROM call and the
+            index of the previous one for the following ones.</LI>
+        <LI>An mlink-type relocation table for this ROM call. See
+            <A HREF="$$LINK(insert_mlink_relocs)">__ld_insert_mlink_relocs</A>
+            for the format used.
+            The reference symbol used if there is no previous reloc (i.e. for
+            the first reloc) is <CODE>__ld_mlink_rom_calls_ref</CODE>.
+            </LI>
+        </UL></LI>
+    <LI><B>1 byte:</B> 0</LI>
+    </UL></LI>
+</UL>
+For more information on processing ROM call relocation, see
+<A HREF="$$LINK(insert_kernel_rom_calls)">__ld_insert_kernel_rom_calls</A>.

+ 1 - 1
symbols_ld_bss_ref_count.hss

@@ -1,6 +1,6 @@
 [Main]
 Title=__ld_bss_ref_count
-See Also=insert_kernel_bss_refs: __ld_insert_kernel_bss_refs, insert_compressed_bss_refs: __ld_compressed_bss_refs, insert_fargo021_bss_refs: __ld_fargo021_bss_refs, insert_preos_compressed_tables: __ld_insert_preos_compressed_tables
+See Also=insert_kernel_bss_refs: __ld_insert_kernel_bss_refs, insert_mlink_bss_refs: __ld_insert_mlink_bss_refs, insert_compressed_bss_refs: __ld_compressed_bss_refs, insert_fargo021_bss_refs: __ld_fargo021_bss_refs, insert_preos_compressed_tables: __ld_insert_preos_compressed_tables
 
 [Top]
 This built-in symbol represents the number of references to the BSS section.

+ 1 - 1
symbols_ld_data_ref_count.hss

@@ -1,6 +1,6 @@
 [Main]
 Title=__ld_data_ref_count
-See Also=insert_kernel_data_refs: __ld_insert_kernel_data_refs, insert_compressed_data_refs: __ld_insert_compressed_data_refs
+See Also=insert_kernel_data_refs: __ld_insert_kernel_data_refs, insert_mlink_data_refs: __ld_insert_mlink_data_refs, insert_compressed_data_refs: __ld_insert_compressed_data_refs
 
 [Top]
 This built-in symbol represents the number of references to the data section,

+ 1 - 1
symbols_ld_reloc_count.hss

@@ -1,6 +1,6 @@
 [Main]
 Title=__ld_reloc_count
-See Also=insert_kernel_relocs: __ld_insert_kernel_relocs, insert_compressed_relocs: __ld_insert_compressed_relocs, insert_fargo021_relocs: __ld_insert_fargo021_relocs, insert_preos_compressed_tables: __ld_insert_preos_compressed_tables
+See Also=insert_kernel_relocs: __ld_insert_kernel_relocs, insert_mlink_relocs: __ld_insert_mlink_relocs, insert_compressed_relocs: __ld_insert_compressed_relocs, insert_fargo021_relocs: __ld_insert_fargo021_relocs, insert_preos_compressed_tables: __ld_insert_preos_compressed_tables
 
 [Top]
 This built-in symbol resolves to the number of absolute relocation entries in

+ 1 - 1
symbols_ld_rom_call_count.hss

@@ -1,6 +1,6 @@
 [Main]
 Title=__ld_rom_call_count
-See Also=insert_kernel_rom_calls: __ld_insert_kernel_rom_calls, insert_compressed_rom_calls: __ld_insert_compressed_rom_calls, insert_preos_compressed_tables: __ld_insert_preos_compressed_tables, symbols_rom_call: ROM Calls
+See Also=insert_kernel_rom_calls: __ld_insert_kernel_rom_calls, insert_mlink_rom_calls: __ld_insert_mlink_rom_calls, insert_compressed_rom_calls: __ld_insert_compressed_rom_calls, insert_preos_compressed_tables: __ld_insert_preos_compressed_tables, symbols_rom_call: ROM Calls
 
 [Top]
 This built-in symbol resolves to the number of

Some files were not shown because too many files changed in this diff