This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: Fix typo in elf32-mips.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]