public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: msnyder@sonic.net
To: "H.J. Lu" <hjl@lucon.org>
Cc: msnyder@sonic.net, binutils@sourceware.org
Subject: Re: [patch] elf32-i386.c, check for null
Date: Fri, 27 Jul 2007 01:57:00 -0000	[thread overview]
Message-ID: <4869.12.7.175.2.1185500521.squirrel@webmail.sonic.net> (raw)
In-Reply-To: <20070726022013.GB29523@lucon.org>

[-- Attachment #1: Type: text/plain, Size: 103 bytes --]


>
> I prefer BFD_ASSERT (h != NULL) and R_386_GNU_VTINHERIT has the same
> issue.

OK -- how's this?


[-- Attachment #2: h2.txt --]
[-- Type: text/plain, Size: 1631 bytes --]

2007-07-25  Michael Snyder  <msnyder@access-company.com>

	* elf32-i386.c (elf_i386_check_relocs): Check for null pointer.

Index: elf32-i386.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i386.c,v
retrieving revision 1.174
diff -p -r1.174 elf32-i386.c
*** elf32-i386.c	3 Jul 2007 14:26:41 -0000	1.174
--- elf32-i386.c	27 Jul 2007 01:40:47 -0000
*************** elf_i386_check_relocs (bfd *abfd,
*** 1270,1284 ****
  	  /* This relocation describes the C++ object vtable hierarchy.
  	     Reconstruct it for later use during GC.  */
  	case R_386_GNU_VTINHERIT:
! 	  if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
! 	    return FALSE;
  	  break;
  
  	  /* This relocation describes which C++ vtable entries are actually
  	     used.  Record for later use during GC.  */
  	case R_386_GNU_VTENTRY:
! 	  if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
! 	    return FALSE;
  	  break;
  
  	default:
--- 1270,1288 ----
  	  /* This relocation describes the C++ object vtable hierarchy.
  	     Reconstruct it for later use during GC.  */
  	case R_386_GNU_VTINHERIT:
! 	  BFD_ASSERT (h != NULL);
! 	  if (h != NULL)
! 	    if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
! 	      return FALSE;
  	  break;
  
  	  /* This relocation describes which C++ vtable entries are actually
  	     used.  Record for later use during GC.  */
  	case R_386_GNU_VTENTRY:
! 	  BFD_ASSERT (h != NULL);
! 	  if (h != NULL)
! 	    if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
! 	      return FALSE;
  	  break;
  
  	default:

  reply	other threads:[~2007-07-27  1:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-26  1:32 msnyder
2007-07-26  6:18 ` H.J. Lu
2007-07-27  1:57   ` msnyder [this message]
2007-07-27  4:46     ` H.J. Lu
2007-07-27 18:54       ` msnyder

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=4869.12.7.175.2.1185500521.squirrel@webmail.sonic.net \
    --to=msnyder@sonic.net \
    --cc=binutils@sourceware.org \
    --cc=hjl@lucon.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).