- Fix .rela case of R_MIPS_26 relocation. Addednds save diferently for

.rel and .rela sections. It's shifted right two bits for former
   but saved as-is for latter.
This commit is contained in:
Oleksandr Tymoshenko 2012-01-13 07:00:47 +00:00
parent 533e5d6df3
commit 33b570d348

View File

@ -227,7 +227,11 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data,
return (-1);
addend &= 0x03ffffff;
addend <<= 2;
/*
* Addendum for .rela R_MIPS_26 is not shifted right
*/
if (rela == NULL)
addend <<= 2;
addr += ((Elf_Addr)where & 0xf0000000) | addend;
addr >>= 2;