public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: Fix typo in elf32-mips.c
@ 2001-08-30  8:26 H . J . Lu
  2001-08-30 14:34 ` Geoff Keating
  0 siblings, 1 reply; 3+ messages in thread
From: H . J . Lu @ 2001-08-30  8:26 UTC (permalink / raw)
  To: binutils

I checked in the following patch as an obvious fix.


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

	* elf32-mips.c (mips_elf_calculate_relocation): Don't create
	dynamic relocation for undefined weak symbols when creating
	executables. Check h->root.root.type, instead of h->root.type.

--- elf32-mips.c.dynamic	Thu Aug 30 08:00:39 2001
+++ elf32-mips.c	Thu Aug 30 08:06:21 2001
@@ -6334,7 +6334,8 @@ mips_elf_calculate_relocation (abfd,
       if ((info->shared
 	   || (elf_hash_table (info)->dynamic_sections_created
 	       && h != NULL
-	       && (h->root.type == bfd_link_hash_defweak
+	       && 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)))
 	  && (input_section->flags & SEC_ALLOC) != 0)

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

* Re: PATCH: Fix typo in elf32-mips.c
  2001-08-30  8:26 PATCH: Fix typo in elf32-mips.c H . J . Lu
@ 2001-08-30 14:34 ` Geoff Keating
  2001-08-30 14:36   ` H . J . Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Geoff Keating @ 2001-08-30 14:34 UTC (permalink / raw)
  To: hjl; +Cc: binutils

> Date: Thu, 30 Aug 2001 08:26:16 -0700
> From: "H . J . Lu" <hjl@lucon.org>

> I checked in the following patch as an obvious fix.

I think this is not obvious.  In fact, I think it may be wrong.
What happens if a weak symbol is defined by a new version of a shared library?

I really think that patches like this should be properly reviewed.  I
am concerned by the trend of certain contributors deciding that any
short patch must be "obvious" and therefore doesn't need approval.

> 
> H.J.
> -----
> 2001-08-30  H.J. Lu  <hjl@gnu.org>
> 
> 	* elf32-mips.c (mips_elf_calculate_relocation): Don't create
> 	dynamic relocation for undefined weak symbols when creating
> 	executables. Check h->root.root.type, instead of h->root.type.
> 
> --- elf32-mips.c.dynamic	Thu Aug 30 08:00:39 2001
> +++ elf32-mips.c	Thu Aug 30 08:06:21 2001
> @@ -6334,7 +6334,8 @@ mips_elf_calculate_relocation (abfd,
>        if ((info->shared
>  	   || (elf_hash_table (info)->dynamic_sections_created
>  	       && h != NULL
> -	       && (h->root.type == bfd_link_hash_defweak
> +	       && 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)))
>  	  && (input_section->flags & SEC_ALLOC) != 0)
> 


-- 
- Geoffrey Keating <geoffk@geoffk.org>

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

* Re: PATCH: Fix typo in elf32-mips.c
  2001-08-30 14:34 ` Geoff Keating
@ 2001-08-30 14:36   ` H . J . Lu
  0 siblings, 0 replies; 3+ messages in thread
From: H . J . Lu @ 2001-08-30 14:36 UTC (permalink / raw)
  To: Geoff Keating; +Cc: binutils

On Thu, Aug 30, 2001 at 02:52:20PM -0700, Geoff Keating wrote:
> > Date: Thu, 30 Aug 2001 08:26:16 -0700
> > From: "H . J . Lu" <hjl@lucon.org>
> 
> > I checked in the following patch as an obvious fix.
> 
> I think this is not obvious.  In fact, I think it may be wrong.
> What happens if a weak symbol is defined by a new version of a shared library?
> 

I have reverted them and checked in a different one to address your
concern.


H.J.

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

end of thread, other threads:[~2001-08-30 14:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-30  8:26 PATCH: Fix typo in elf32-mips.c H . J . Lu
2001-08-30 14:34 ` Geoff Keating
2001-08-30 14:36   ` H . J . Lu

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).