This is the mail archive of the binutils@sourceware.cygnus.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]

** CRITICAL ** PATCH for 2.10.



On FreeBSD one may alter the way malloc(3) works thru
/etc/malloc.conf or the MALLOC_OPTIONS env var.  Setting either to "J"
causes `ld' to receive a sig 10.  From malloc(3):

    J   Each byte of new memory allocated by malloc(), realloc() or
        reallocf() as well as all memory returned by free(), realloc() or
        reallocf() will be initialized to 0xd0.  This options also sets
        the ``R'' option.  This is intended for debugging and will impact
        performance negatively.

So `ld' seems to be assume zero'ed out memory from malloc(3).  One of the
FreeBSD users (Anatoly Vorobey <mellon@pobox.com>) found this diff to fix
the problem.  I've created a ChangeLog entry for him.


2000-05-28  Anatoly Vorobey  <mellon@pobox.com>

	* elf.c (_bfd_elf_link_hash_table_init): Initialize the dynlocal
	to NULL as the other fields of struct elf_link_hash_table are.  This
	fixes a problem where `ld' assumed malloc(3) returned zero'ed out
	memory.


----- Forwarded message from Anatoly Vorobey <mellon@pobox.com> -----
At some point, someone added a new field into a hash table struct and
didn't add initialization for it into the general hash table struct init
func.  This patch cures the problem for me.

Index: elf.c
===================================================================
RCS file: /freebsd/cvs/src/contrib/binutils/bfd/elf.c,v
retrieving revision 1.6
diff -u -r1.6 elf.c
--- elf.c	2000/05/13 16:44:19	1.6
+++ elf.c	2000/05/29 04:58:34
@@ -979,6 +979,7 @@
   table->needed = NULL;
   table->hgot = NULL;
   table->stab_info = NULL;
+  table->dynlocal = NULL;
   return _bfd_link_hash_table_init (&table->root, abfd, newfunc);
 }
 
-- 
Anatoly Vorobey,
mellon@pobox.com http://pobox.com/~mellon/
"Angels can fly because they take themselves lightly" - G.K.Chesterton
----- End forwarded message -----

-- 
-- David  (obrien@FreeBSD.org)

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