This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] libelf: Fix elf_newdata when raw data has been read, but not converted.
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Fri, 06 Feb 2015 22:28:16 +0100
- Subject: Re: [PATCH] libelf: Fix elf_newdata when raw data has been read, but not converted.
On Wed, Jan 21, 2015 at 05:57:03PM +0100, Mark Wielaard wrote:
> Subject: [PATCH] libelf: Fix elf_newdata when raw ELF file/image data is
> available.
>
> When ELF data for a section has been read by elf_rawdata, data_read
> and rawdata_base are set, but data_list_rear will not be set until the
> data will be converted (by elf_getdata). elf_newdata would overwrite
> the existing data in that case. Both elf_getdata and elf_update rely
> on the fact that when data_list_rear is set they don't have to look
> at the raw data anymore. So make sure we update the data list properly
> before adding any new data and raw data is available in elf_newdata.
>
> Add newdata test that calls elf_newdata before and after elf_rawdata
> and elf_getdata and checks the new size and contents of the section.
I pushed this to master.