mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 21:41:47 +08:00
* elf32-mips.c (_bfd_mips_elf_relocate_section): Handle R_MIPS_26
and R_MIPS16_26 relocations correctly when relocating. (_bfd_mips_elf_check_relocs): Don't assume that R_MIPS_CALL_HI16 and R_MIPS_CALL_LO16 are for global symbols.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
1999-08-02 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
|
* elf32-mips.c (_bfd_mips_elf_relocate_section): Handle R_MIPS_26
|
||||||
|
and R_MIPS16_26 relocations correctly when relocating.
|
||||||
|
(_bfd_mips_elf_check_relocs): Don't assume that R_MIPS_CALL_HI16
|
||||||
|
and R_MIPS_CALL_LO16 are for global symbols.
|
||||||
|
|
||||||
1999-08-02 Jakub Jelinek <jj@ultra.linux.cz>
|
1999-08-02 Jakub Jelinek <jj@ultra.linux.cz>
|
||||||
|
|
||||||
* elflink.h (elf_bfd_final_link): Copy the whole isym, not just
|
* elflink.h (elf_bfd_final_link): Copy the whole isym, not just
|
||||||
|
@ -6552,6 +6552,11 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||||||
| ((addend & 0x7e00000) >> 16)
|
| ((addend & 0x7e00000) >> 16)
|
||||||
| (addend & 0x1f));
|
| (addend & 0x1f));
|
||||||
}
|
}
|
||||||
|
else if (r_type == R_MIPS16_26
|
||||||
|
|| r_type == R_MIPS16_26)
|
||||||
|
/* The addend is stored without its two least
|
||||||
|
significant bits (which are always zero.) */
|
||||||
|
addend << 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
addend = rel->r_addend;
|
addend = rel->r_addend;
|
||||||
@ -6590,6 +6595,11 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
|||||||
The subsequent R_MIPS_LO16 will handle the low-order bits. */
|
The subsequent R_MIPS_LO16 will handle the low-order bits. */
|
||||||
if (r_type == R_MIPS_HI16 || r_type == R_MIPS_GOT16)
|
if (r_type == R_MIPS_HI16 || r_type == R_MIPS_GOT16)
|
||||||
addend >>= 16;
|
addend >>= 16;
|
||||||
|
/* If the relocation is for an R_MIPS_26 relocation, then
|
||||||
|
the two low-order bits are not stored in the object file;
|
||||||
|
they are implicitly zero. */
|
||||||
|
else if (r_type == R_MIPS_26 || r_type == R_MIPS16_26)
|
||||||
|
addend >>= 2;
|
||||||
|
|
||||||
if (rela_relocation_p)
|
if (rela_relocation_p)
|
||||||
/* If this is a RELA relocation, just update the addend.
|
/* If this is a RELA relocation, just update the addend.
|
||||||
@ -7373,6 +7383,8 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs)
|
|||||||
|
|
||||||
case R_MIPS_CALL_HI16:
|
case R_MIPS_CALL_HI16:
|
||||||
case R_MIPS_CALL_LO16:
|
case R_MIPS_CALL_LO16:
|
||||||
|
if (h != NULL)
|
||||||
|
{
|
||||||
/* This symbol requires a global offset table entry. */
|
/* This symbol requires a global offset table entry. */
|
||||||
if (!mips_elf_record_global_got_symbol (h, info, g))
|
if (!mips_elf_record_global_got_symbol (h, info, g))
|
||||||
return false;
|
return false;
|
||||||
@ -7382,7 +7394,7 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs)
|
|||||||
elf_adjust_dynamic_symbol in elflink.h. */
|
elf_adjust_dynamic_symbol in elflink.h. */
|
||||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||||
h->type = STT_FUNC;
|
h->type = STT_FUNC;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R_MIPS_GOT16:
|
case R_MIPS_GOT16:
|
||||||
|
Reference in New Issue
Block a user