public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <joseph@codesourcery.com>
To: binutils@sourceware.org
Subject: Fix use of uninitialized data in elf32-ppc.c
Date: Fri, 28 Jan 2011 23:25:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1101282324470.23098@digraph.polyomino.org.uk> (raw)

This patch fixes nondeterministic behavior in the ppc32 linker arising
from the has_sda_refs field in struct ppc_elf_link_hash_entry not
being initialized.

Tested with no regressions with cross to powerpc-linux-gnu.  OK to
commit?

2011-01-28  Joseph Myers  <joseph@codesourcery.com>

	* elf32-ppc.c (ppc_elf_link_hash_newfunc): Initialize has_sda_refs
	field.

Index: elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.290
diff -u -p -r1.290 elf32-ppc.c
--- elf32-ppc.c	25 Oct 2010 15:54:14 -0000	1.290
+++ elf32-ppc.c	28 Jan 2011 23:22:31 -0000
@@ -2785,6 +2785,7 @@ ppc_elf_link_hash_newfunc (struct bfd_ha
       ppc_elf_hash_entry (entry)->linker_section_pointer = NULL;
       ppc_elf_hash_entry (entry)->dyn_relocs = NULL;
       ppc_elf_hash_entry (entry)->tls_mask = 0;
+      ppc_elf_hash_entry (entry)->has_sda_refs = 0;
     }
 
   return entry;

-- 
Joseph S. Myers
joseph@codesourcery.com

             reply	other threads:[~2011-01-28 23:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-28 23:25 Joseph S. Myers [this message]
2011-01-29  0:02 ` Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.1101282324470.23098@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).