This is the mail archive of the 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  <>

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

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
Happy GNU Year!                     oliva@{,}
Red Hat GCC Developer                 aoliva@{,}
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]