(gprel16_reloc_p): New static inline function.
* elfxx-mips.c (_bfd_mips_elf_check_relocs)
[R_MIPS16_GOT16, R_MIPS_GOT16, R_MIPS_GOT_HI16, R_MIPS_GOT_LO16]:
Use got16_reloc_p.
(_bfd_mips_elf_relocate_section)[bfd_reloc_overflow]: Use
gprel16_reloc_p.
* elf32-mips.c (mips_info_to_howto_rel): Likewise.
* elfn32-mips.c (mips_info_to_howto_rel): Likewise.
+2010-07-27 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * elfxx-mips.h: Include "elf/mips.h".
+ (gprel16_reloc_p): New static inline function.
+ * elfxx-mips.c (_bfd_mips_elf_check_relocs)
+ [R_MIPS16_GOT16, R_MIPS_GOT16, R_MIPS_GOT_HI16, R_MIPS_GOT_LO16]:
+ Use got16_reloc_p.
+ (_bfd_mips_elf_relocate_section)[bfd_reloc_overflow]: Use
+ gprel16_reloc_p.
+ * elf32-mips.c (mips_info_to_howto_rel): Likewise.
+ * elfn32-mips.c (mips_info_to_howto_rel): Likewise.
+
2010-07-27 Maciej W. Rozycki <macro@codesourcery.com>
* elf64-mips.c (mips_elf64_howto_table_rela)
when we do the relocation, because the symbol manipulations done
by the linker may cause us to lose track of the input BFD. */
if (((*cache_ptr->sym_ptr_ptr)->flags & BSF_SECTION_SYM) != 0
- && (r_type == (unsigned int) R_MIPS_GPREL16
- || r_type == (unsigned int) R_MIPS_LITERAL))
+ && (gprel16_reloc_p (r_type) || r_type == (unsigned int) R_MIPS_LITERAL))
cache_ptr->addend = elf_gp (abfd);
}
when we do the relocation, because the symbol manipulations done
by the linker may cause us to lose track of the input BFD. */
if (((*cache_ptr->sym_ptr_ptr)->flags & BSF_SECTION_SYM) != 0
- && (r_type == (unsigned int) R_MIPS_GPREL16
- || r_type == (unsigned int) R_MIPS_LITERAL))
+ && (gprel16_reloc_p (r_type) || r_type == (unsigned int) R_MIPS_LITERAL))
cache_ptr->addend = elf_gp (abfd);
}
howto = MIPS_ELF_RTYPE_TO_HOWTO (abfd, r_type, FALSE);
addend = mips_elf_read_rel_addend (abfd, rel,
howto, contents);
- if (r_type == R_MIPS_GOT16)
+ if (got16_reloc_p (r_type))
mips_elf_add_lo16_rel_addend (abfd, rel, rel_end,
contents, &addend);
else
BFD_ASSERT (htab != NULL);
BFD_ASSERT (name != NULL);
if (!htab->small_data_overflow_reported
- && (howto->type == R_MIPS_GPREL16
+ && (gprel16_reloc_p (howto->type)
|| howto->type == R_MIPS_LITERAL))
{
msg = _("small-data section exceeds 64KB;"
#include "elf/common.h"
#include "elf/internal.h"
+#include "elf/mips.h"
extern bfd_boolean _bfd_mips_elf_new_section_hook
(bfd *, asection *);
extern bfd_boolean _bfd_mips_elf_common_definition (Elf_Internal_Sym *);
+static inline bfd_boolean
+gprel16_reloc_p (unsigned int r_type)
+{
+ return r_type == R_MIPS_GPREL16 || r_type == R_MIPS16_GPREL;
+}
+
#define elf_backend_common_definition _bfd_mips_elf_common_definition
#define elf_backend_name_local_section_symbols \
_bfd_mips_elf_name_local_section_symbols