aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2001-08-27 15:40:38 +0000
committerH.J. Lu <hjl.tools@gmail.com>2001-08-27 15:40:38 +0000
commit14d5043ad0bdc99e43b4a659fdd339946dde5243 (patch)
tree4794db05a444e964df189eb2ead34c5643fb766d /bfd
parent9e80ff3a408eea05b93b74ccaa98f0b5e7df0fe0 (diff)
downloadgdb-14d5043ad0bdc99e43b4a659fdd339946dde5243.zip
gdb-14d5043ad0bdc99e43b4a659fdd339946dde5243.tar.gz
gdb-14d5043ad0bdc99e43b4a659fdd339946dde5243.tar.bz2
2001-08-27 H.J. Lu <hjl@gnu.org>
* 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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/elf32-mips.c7
2 files changed, 13 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7df8ea2..4fb59bd 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,13 @@
2001-08-27 H.J. Lu <hjl@gnu.org>
+ * 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 <hjl@gnu.org>
+
* elf32-mips.c (_bfd_mips_elf_hide_symbol): Add prototype.
(_bfd_mips_elf_copy_indirect_symbol): Likewise.
(_bfd_elf32_mips_grok_prstatus): Likewise.
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index cc2f006..1f6ecef 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