Index: uspace/lib/c/arch/sparc64/src/rtld/reloc.c
===================================================================
--- uspace/lib/c/arch/sparc64/src/rtld/reloc.c	(revision 1c3c287faa0cdc5e3cedcbfc47dc2ffd4b4e73bd)
+++ uspace/lib/c/arch/sparc64/src/rtld/reloc.c	(revision 4099129ccf64362ab0419129df91da4d122df9cf)
@@ -90,4 +90,5 @@
 	elf_symbol_t *sym_def;
 	module_t *dest;
+	uint32_t *plt;
 
 	DPRINTF("parse relocation table\n");
@@ -96,4 +97,6 @@
 	rt_entries = rt_size / sizeof(elf_rela_t);
 	str_tab = m->dyn.str_tab;
+
+	plt = (uint32_t *)m->dyn.plt_got;
 
 	DPRINTF("rel table address: 0x%zx, entries: %zd\n", (uintptr_t)rt, rt_entries);
@@ -218,5 +221,9 @@
 			 * r_ptr points to the PLT entry, sym_addr contains
 			 * address of the symbol.
+			 *
+			 * XXX This only works for the first 32768 entries.
+			 * If there are more, the layout is more complex.
 			 */
+			assert((uint32_t *)r_ptr - plt < 32768 * 8);
 			fill_plt_entry_generic((uint32_t *)r_ptr, sym_addr);
 			smc_coherence(r_ptr, 32);
