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: binutils is broken


On Wed, Oct 03, 2001 at 06:00:34PM +0930, Alan Modra wrote:
> Here's what I'm about to commit to fix the problem.
> 
> 	* elflink.h (elf_fix_symbol_flags): Copy flags to weakdef using
> 	elf_backend_copy_indirect_symbol so that backend has a chance to
> 	copy other necessary fields.
> 	* elf-bfd.h (struct elf_backend_data): Update description of
> 	elf_backend_copy_indirect_symbol.
> 	* elf.c (_bfd_elf_link_hash_copy_indirect): Bail out after
> 	copying flags if this is a weakdef.
> 	* elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise.
> 	(elfNN_ia64_aix_add_symbol_hook): Use elf_link_hash_lookup rather
> 	than bfd_link_hash_lookup.
> 	* elf32-i386 (elf_i386_adjust_dynamic_symbol): Don't do copy
> 	reloc processing for weakdefs.
> 	* elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
> 	* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.

Oops.  Missed the copy_indirect_symbol in elf32-mips.c.  Sorry, H.J.

	* elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): Bail out after
	copying flags if this is a weakdef.

-- 
Alan Modra

Index: elf32-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-mips.c,v
retrieving revision 1.116
diff -u -p -r1.116 elf32-mips.c
--- elf32-mips.c	2001/10/04 05:50:29	1.116
+++ elf32-mips.c	2001/10/04 16:07:25
@@ -8074,7 +8074,8 @@ _bfd_mips_elf_gc_sweep_hook (abfd, info,
 
 /* Copy data from a MIPS ELF indirect symbol to its direct symbol,
    hiding the old indirect symbol.  Process additional relocation
-   information.  */
+   information.  Also called for weakdefs, in which case we just let
+   _bfd_elf_link_hash_copy_indirect copy the flags for us.  */
 
 static void
 _bfd_mips_elf_copy_indirect_symbol (dir, ind)
@@ -8083,6 +8084,9 @@ _bfd_mips_elf_copy_indirect_symbol (dir,
   struct mips_elf_link_hash_entry *dirmips, *indmips;
 
   _bfd_elf_link_hash_copy_indirect (dir, ind);
+
+  if (dir == ind->weakdef)
+    return;
 
   dirmips = (struct mips_elf_link_hash_entry *) dir;
   indmips = (struct mips_elf_link_hash_entry *) ind;


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