diff options
-rw-r--r-- | sys/mips/mips/elf_machdep.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/mips/mips/elf_machdep.c b/sys/mips/mips/elf_machdep.c index a147a7f..d374713 100644 --- a/sys/mips/mips/elf_machdep.c +++ b/sys/mips/mips/elf_machdep.c @@ -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; |