b543cdd95a0f9dfc33c862585f108a7a19728a10 |
|
20-Jan-2015 |
Mark Wielaard <mjw@redhat.com> |
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. Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/tests/newdata.c
|