public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [Patch]: som.c: do not free relocations
@ 2010-05-28  8:30 Tristan Gingold
  2010-06-07 14:15 ` Ping " Tristan Gingold
  2010-06-08 10:00 ` Nick Clifton
  0 siblings, 2 replies; 4+ messages in thread
From: Tristan Gingold @ 2010-05-28  8:30 UTC (permalink / raw)
  To: binutils

Hi,

there is a subtile bug in som.c:som_bfd_free_cached_info:  relocations were freed, which is
wrong as they are allocated in som_slurp_reloc_table using bfd_zalloc.

Ok to commit ?

Tristan.

bfd/
2010-05-28  Tristan Gingold  <gingold@adacore.com>

	* som.c (som_bfd_free_cached_info): Do not free relocations as
	they were allocated with bfd_zalloc.



index fbdc2b4..c793cb9 100644
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -6304,8 +6304,7 @@ som_bfd_free_cached_info (bfd *abfd)
       /* Free the native relocations.  */
       o->reloc_count = (unsigned) -1;
       FREE (som_section_data (o)->reloc_stream);
-      /* Free the generic relocations.  */
-      FREE (o->relocation);
+      /* Do not free the generic relocations as they are objalloc'ed.  */
     }
 #undef FREE

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

* Ping [Patch]: som.c: do not free relocations
  2010-05-28  8:30 [Patch]: som.c: do not free relocations Tristan Gingold
@ 2010-06-07 14:15 ` Tristan Gingold
  2010-06-08 10:00 ` Nick Clifton
  1 sibling, 0 replies; 4+ messages in thread
From: Tristan Gingold @ 2010-06-07 14:15 UTC (permalink / raw)
  To: binutils

Hi,

ping for the whole SOM patch set.

Tristan.

On May 28, 2010, at 10:30 AM, Tristan Gingold wrote:

> Hi,
> 
> there is a subtile bug in som.c:som_bfd_free_cached_info:  relocations were freed, which is
> wrong as they are allocated in som_slurp_reloc_table using bfd_zalloc.
> 
> Ok to commit ?
> 
> Tristan.
> 
> bfd/
> 2010-05-28  Tristan Gingold  <gingold@adacore.com>
> 
> 	* som.c (som_bfd_free_cached_info): Do not free relocations as
> 	they were allocated with bfd_zalloc.
> 
> 
> 
> index fbdc2b4..c793cb9 100644
> --- a/bfd/som.c
> +++ b/bfd/som.c
> @@ -6304,8 +6304,7 @@ som_bfd_free_cached_info (bfd *abfd)
>       /* Free the native relocations.  */
>       o->reloc_count = (unsigned) -1;
>       FREE (som_section_data (o)->reloc_stream);
> -      /* Free the generic relocations.  */
> -      FREE (o->relocation);
> +      /* Do not free the generic relocations as they are objalloc'ed.  */
>     }
> #undef FREE
> 

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

* Re: [Patch]: som.c: do not free relocations
  2010-05-28  8:30 [Patch]: som.c: do not free relocations Tristan Gingold
  2010-06-07 14:15 ` Ping " Tristan Gingold
@ 2010-06-08 10:00 ` Nick Clifton
  2010-06-08 15:48   ` Tristan Gingold
  1 sibling, 1 reply; 4+ messages in thread
From: Nick Clifton @ 2010-06-08 10:00 UTC (permalink / raw)
  To: Tristan Gingold; +Cc: binutils

Hi Tristan,

> bfd/
> 2010-05-28  Tristan Gingold<gingold@adacore.com>
>
> 	* som.c (som_bfd_free_cached_info): Do not free relocations as
> 	they were allocated with bfd_zalloc.

Approved - please apply.

Cheers
   Nick


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

* Re: [Patch]: som.c: do not free relocations
  2010-06-08 10:00 ` Nick Clifton
@ 2010-06-08 15:48   ` Tristan Gingold
  0 siblings, 0 replies; 4+ messages in thread
From: Tristan Gingold @ 2010-06-08 15:48 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils


On Jun 8, 2010, at 11:59 AM, Nick Clifton wrote:

> Hi Tristan,
> 
>> bfd/
>> 2010-05-28  Tristan Gingold<gingold@adacore.com>
>> 
>> 	* som.c (som_bfd_free_cached_info): Do not free relocations as
>> 	they were allocated with bfd_zalloc.
> 
> Approved - please apply.

Thanks, committed.

There are other patches for som that haven't been reviewed yet:

http://sourceware.org/ml/binutils/2010-05/msg00393.html
http://sourceware.org/ml/binutils/2010-05/msg00394.html
http://sourceware.org/ml/binutils/2010-05/msg00395.html
http://sourceware.org/ml/binutils/2010-05/msg00396.html

Tristan.

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

end of thread, other threads:[~2010-06-08 15:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-28  8:30 [Patch]: som.c: do not free relocations Tristan Gingold
2010-06-07 14:15 ` Ping " Tristan Gingold
2010-06-08 10:00 ` Nick Clifton
2010-06-08 15:48   ` Tristan Gingold

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