From: H.J. Lu Date: Mon, 27 Aug 2001 15:40:38 +0000 (+0000) Subject: 2001-08-27 H.J. Lu X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=14d5043ad0bdc99e43b4a659fdd339946dde5243;p=binutils-gdb.git 2001-08-27 H.J. Lu * elf32-mips.c (mips_elf_create_dynamic_relocation): Add more sanity check. (mips_elf_calculate_relocation): Create dynamic relocation for symbols with weak definition or the ELF_LINK_HASH_DEF_REGULAR bit is not set. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 7df8ea2f07e..4fb59bd93c1 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2001-08-27 H.J. Lu + + * elf32-mips.c (mips_elf_create_dynamic_relocation): Add more + sanity check. + (mips_elf_calculate_relocation): Create dynamic relocation for + symbols with weak definition or the ELF_LINK_HASH_DEF_REGULAR + bit is not set. + 2001-08-27 H.J. Lu * elf32-mips.c (_bfd_mips_elf_hide_symbol): Add prototype. diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index cc2f00659d0..1f6ecef2d60 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -5830,6 +5830,8 @@ mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec, MIPS_ELF_REL_DYN_SECTION_NAME (output_bfd)); BFD_ASSERT (sreloc != NULL); BFD_ASSERT (sreloc->contents != NULL); + BFD_ASSERT (sreloc->reloc_count * MIPS_ELF_REL_SIZE (output_bfd) + < sreloc->_raw_size); skip = false; @@ -6330,8 +6332,9 @@ mips_elf_calculate_relocation (abfd, if ((info->shared || (elf_hash_table (info)->dynamic_sections_created && h != NULL - && ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) - != 0))) + && (h->root.type == bfd_link_hash_defweak + || (h->root.elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0))) && (input_section->flags & SEC_ALLOC) != 0) { /* If we're creating a shared library, or this relocation is