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]
Other format: [Raw text]

Re: powerpc64 multiple toc refinement


On Thu, Jun 19, 2003 at 09:18:08PM +0930, Alan Modra wrote:
> 	(ppc64_elf_link_hash_table_create): zmalloc rather than clearing
> 	individual fields.

Oops, can't just rip out all those zero initializations as
_bfd_elf_link_hash_table_init sets them to non-zero values.

	* elf64-ppc.c (ppc64_elf_link_hash_table_create): Reinstate init of
	elf hash tab fields.

Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.111
diff -u -p -r1.111 elf64-ppc.c
--- bfd/elf64-ppc.c	19 Jun 2003 13:50:35 -0000	1.111
+++ bfd/elf64-ppc.c	19 Jun 2003 15:08:00 -0000
@@ -3054,6 +3054,15 @@ ppc64_elf_link_hash_table_create (abfd)
   if (!bfd_hash_table_init (&htab->branch_hash_table, branch_hash_newfunc))
     return NULL;
 
+  /* Initializing two fields of the union is just cosmetic.  We really
+     only care about glist, but when compiled on a 32-bit host the
+     bfd_vma fields are larger.  Setting the bfd_vma to zero makes
+     debugger inspection of these fields look nicer.  */
+  htab->elf.init_refcount.refcount = 0;
+  htab->elf.init_refcount.glist = NULL;
+  htab->elf.init_offset.offset = 0;
+  htab->elf.init_offset.glist = NULL;
+
   return &htab->elf.root;
 }
 

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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