public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] coff_read_internal_relocs, count == 0
@ 2007-07-27  2:07 msnyder
  2007-07-27  4:51 ` Alan Modra
  0 siblings, 1 reply; 3+ messages in thread
From: msnyder @ 2007-07-27  2:07 UTC (permalink / raw)
  To: binutils

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



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

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

	* coffgen.c (_bfd_coff_read_internal_relocs): If count is zero return.

Index: coffgen.c
===================================================================
RCS file: /cvs/src/src/bfd/coffgen.c,v
retrieving revision 1.62
diff -p -r1.62 coffgen.c
*** coffgen.c	26 Jul 2007 19:06:12 -0000	1.62
--- coffgen.c	27 Jul 2007 01:56:36 -0000
*************** _bfd_coff_read_internal_relocs (bfd *abf
*** 409,414 ****
--- 409,417 ----
    struct internal_reloc *irel;
    bfd_size_type amt;
  
+   if (sec->reloc_count == 0)
+     return internal_relocs;	/* Nothing to do.  */
+ 
    if (coff_section_data (abfd, sec) != NULL
        && coff_section_data (abfd, sec)->relocs != NULL)
      {
*************** _bfd_coff_read_internal_relocs (bfd *abf
*** 425,431 ****
    if (external_relocs == NULL)
      {
        free_external = bfd_malloc (amt);
!       if (free_external == NULL && sec->reloc_count > 0)
  	goto error_return;
        external_relocs = free_external;
      }
--- 428,434 ----
    if (external_relocs == NULL)
      {
        free_external = bfd_malloc (amt);
!       if (free_external == NULL)
  	goto error_return;
        external_relocs = free_external;
      }
*************** _bfd_coff_read_internal_relocs (bfd *abf
*** 439,445 ****
        amt = sec->reloc_count;
        amt *= sizeof (struct internal_reloc);
        free_internal = bfd_malloc (amt);
!       if (free_internal == NULL && sec->reloc_count > 0)
  	goto error_return;
        internal_relocs = free_internal;
      }
--- 442,448 ----
        amt = sec->reloc_count;
        amt *= sizeof (struct internal_reloc);
        free_internal = bfd_malloc (amt);
!       if (free_internal == NULL)
  	goto error_return;
        internal_relocs = free_internal;
      }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] coff_read_internal_relocs, count == 0
  2007-07-27  2:07 [PATCH] coff_read_internal_relocs, count == 0 msnyder
@ 2007-07-27  4:51 ` Alan Modra
  2007-07-27 19:05   ` msnyder
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Modra @ 2007-07-27  4:51 UTC (permalink / raw)
  To: msnyder; +Cc: binutils

On Thu, Jul 26, 2007 at 06:57:46PM -0700, msnyder@sonic.net wrote:
> 	* coffgen.c (_bfd_coff_read_internal_relocs): If count is zero return.

OK.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] coff_read_internal_relocs, count == 0
  2007-07-27  4:51 ` Alan Modra
@ 2007-07-27 19:05   ` msnyder
  0 siblings, 0 replies; 3+ messages in thread
From: msnyder @ 2007-07-27 19:05 UTC (permalink / raw)
  To: msnyder, binutils

> On Thu, Jul 26, 2007 at 06:57:46PM -0700, msnyder@sonic.net wrote:
>> 	* coffgen.c (_bfd_coff_read_internal_relocs): If count is zero return.
>
> OK.

Thanks, committed.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-07-27 18:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-27  2:07 [PATCH] coff_read_internal_relocs, count == 0 msnyder
2007-07-27  4:51 ` Alan Modra
2007-07-27 19:05   ` msnyder

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).