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]

frv FDPIC: __stacksize symbol definition fails to init memory


I added a bug that would cause FDPIC binaries to fail to link under
very rare circumstances.  (At least I think they're rare because of
the amount of use of the toolchain there was before the condition was
met :-)

Anyhow, this obvious patch fixes it.  I'm going ahead and checking it
in.  Apologies for the breakage.

Unfortunately, because of the nature of the bug (dependent on the
compiler used to build the linker and on the linker input that would
cause the garbage in the memory location or register assigned to bh to
be taken as a pointer to a pre-existing hash), I don't have a testcase
that would unreliably expose the problem.

Index: bfd/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* elf32-frv.c (elf32_frv_always_size_sections): Initialize pointer
	to bfd_link_hash_entry passed by reference to
	_bfd_generic_link_add_one_symbol.

Index: bfd/elf32-frv.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-frv.c,v
retrieving revision 1.11
diff -u -p -r1.11 elf32-frv.c
--- bfd/elf32-frv.c 6 Jan 2004 19:18:59 -0000 1.11
+++ bfd/elf32-frv.c 30 Jan 2004 21:04:46 -0000
@@ -3454,7 +3454,7 @@ elf32_frv_always_size_sections (bfd *out
 	  || h->type != STT_OBJECT
 	  || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
 	{
-	  struct bfd_link_hash_entry *bh;
+	  struct bfd_link_hash_entry *bh = NULL;
 
 	  if (!(_bfd_generic_link_add_one_symbol
 		(info, output_bfd, "__stacksize",
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Happy GNU Year!                     oliva@{lsd.ic.unicamp.br, gnu.org}
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist                Professional serial bug killer

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