public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: Fix the mips linker with weak definitions
@ 2001-08-30 14:33 H . J . Lu
  2001-08-31 12:38 ` Eric Christopher
  0 siblings, 1 reply; 2+ messages in thread
From: H . J . Lu @ 2001-08-30 14:33 UTC (permalink / raw)
  To: binutils

The problem with weak definitions is they may be overridden by strong
ones in DSOs later. We have to reserve dynamic relocations for them
at the beginning.


H.J.
----
2001-08-30  H.J. Lu  <hjl@gnu.org>

	* elf32-mips.c (mips_elf_calculate_relocation): Revert the last
	2 changes.
	(_bfd_mips_elf_adjust_dynamic_symbol): Allocate dynamic
	relocations for weak definitions.

--- elf32-mips.c.weak	Thu Aug 30 13:08:34 2001
+++ elf32-mips.c	Thu Aug 30 14:04:36 2001
@@ -6334,10 +6334,8 @@ mips_elf_calculate_relocation (abfd,
       if ((info->shared
 	   || (elf_hash_table (info)->dynamic_sections_created
 	       && h != NULL
-	       && h->root.root.type != bfd_link_hash_undefweak
-	       && (h->root.root.type == bfd_link_hash_defweak
-		   || (h->root.elf_link_hash_flags
-		       & ELF_LINK_HASH_DEF_REGULAR) == 0)))
+	       && ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
+		   != 0)))
 	  && (input_section->flags & SEC_ALLOC) != 0)
 	{
 	  /* If we're creating a shared library, or this relocation is
@@ -8137,7 +8135,9 @@ _bfd_mips_elf_adjust_dynamic_symbol (inf
   hmips = (struct mips_elf_link_hash_entry *) h;
   if (! info->relocateable
       && hmips->possibly_dynamic_relocs != 0
-      && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+      && (h->root.type == bfd_link_hash_defweak
+	  || (h->elf_link_hash_flags 
+	      & ELF_LINK_HASH_DEF_REGULAR) == 0))
     {
       mips_elf_allocate_dynamic_relocations (dynobj,
 					     hmips->possibly_dynamic_relocs);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: Fix the mips linker with weak definitions
  2001-08-30 14:33 PATCH: Fix the mips linker with weak definitions H . J . Lu
@ 2001-08-31 12:38 ` Eric Christopher
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Christopher @ 2001-08-31 12:38 UTC (permalink / raw)
  To: H . J . Lu; +Cc: binutils

> ----
> 2001-08-30  H.J. Lu  <hjl@gnu.org>
> 
> 	* elf32-mips.c (mips_elf_calculate_relocation): Revert the last
> 	2 changes.
> 	(_bfd_mips_elf_adjust_dynamic_symbol): Allocate dynamic
> 	relocations for weak definitions.

This looks OK.  Please commit it.

-eric

-- 
Look out behind you!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-08-31 12:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-30 14:33 PATCH: Fix the mips linker with weak definitions H . J . Lu
2001-08-31 12:38 ` Eric Christopher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).