This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Fix typo in elf32-mips.c
- To: hjl at lucon dot org
- Subject: Re: PATCH: Fix typo in elf32-mips.c
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: Thu, 30 Aug 2001 14:52:20 -0700
- CC: binutils at sourceware dot cygnus dot com
- References: <20010830082616.A8061@lucon.org>
- Reply-to: Geoff Keating <geoffk at redhat dot com>
> 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>