This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: bfd_get_full_section_contents memory leak, plus
On Sat, Oct 20, 2012 at 3:17 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sat, Oct 20, 2012 at 1:28 AM, Alan Modra <amodra@gmail.com> wrote:
>> On Sat, Oct 20, 2012 at 10:42:21AM +1030, Alan Modra wrote:
>>> This on top of Tom's patch ought to cure the failures. Testing
>>> in progress.
>>>
>>> * compress.c: Reinstate 2012-10-19 change.
>>> (bfd_get_full_section_contents): Don't free unless we alloc.
>>> Use proper decompress size. Delete some vars, rename others.
>>
>> Testing successful. Committed.
>>
>
> It breaks objdump. I checked in this tectase to show the
> error.
>
> --
> H.J.
> ---
> 2012-10-20 H.J. Lu <hongjiu.lu@intel.com>
>
> * binutils-all/compress.exp: Add an objdump test.
> * binutils-all/dw2-1.W: New file.
>
This patch works for me:
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 44e857a..b1a5be6 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -2277,6 +2277,7 @@ load_specific_debug_section (enum
dwarf_section_display_enum debug,
the bfd_section, and tell it that the contents are
already in memory. */
sec->contents = section->start;
+ sec->compress_status = COMPRESS_SECTION_NONE;
sec->flags |= SEC_IN_MEMORY;
sec->size = section->size;
--
H.J.
- References:
- Re: bfd_get_full_section_contents memory leak, plus
- Re: bfd_get_full_section_contents memory leak, plus
- Re: bfd_get_full_section_contents memory leak, plus
- Re: bfd_get_full_section_contents memory leak, plus
- Re: bfd_get_full_section_contents memory leak, plus
- Re: bfd_get_full_section_contents memory leak, plus
- Re: bfd_get_full_section_contents memory leak, plus
- Re: bfd_get_full_section_contents memory leak, plus
- Re: bfd_get_full_section_contents memory leak, plus
- Re: bfd_get_full_section_contents memory leak, plus
- Re: bfd_get_full_section_contents memory leak, plus
- Re: bfd_get_full_section_contents memory leak, plus