+2009-02-20 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_runtime_setup):
+ Adjust rela->r_offset by l->l_addr when rewriting PLT.
+
2009-02-20 Joseph Myers <joseph@codesourcery.com>
* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_runtime_setup):
in .rela.plt. */
while (rela < relaend)
{
- *(unsigned int *) rela->r_offset
- = OPCODE_SETHI_G1 | (rela->r_offset - (Elf32_Addr) plt);
- *(unsigned int *) (rela->r_offset + 4)
+ *(unsigned int *) (rela->r_offset + l->l_addr)
+ = OPCODE_SETHI_G1 | (rela->r_offset + l->l_addr
+ - (Elf32_Addr) plt);
+ *(unsigned int *) (rela->r_offset + l->l_addr + 4)
= OPCODE_BA | ((((Elf32_Addr) plt
- - rela->r_offset - 4) >> 2) & 0x3fffff);
+ - rela->r_offset - l->l_addr - 4) >> 2)
+ & 0x3fffff);
if (do_flush)
{
- __asm __volatile ("flush %0" : : "r"(rela->r_offset));
- __asm __volatile ("flush %0+4" : : "r"(rela->r_offset));
+ __asm __volatile ("flush %0" : : "r" (rela->r_offset
+ + l->l_addr));
+ __asm __volatile ("flush %0+4" : : "r" (rela->r_offset
+ + l->l_addr));
}
++rela;
}