Awesome, thanks for looking over this. I only have one comment: there's an extra "xlatefrom.d_size = xlatefrom.d_size;" line that should be removed.
dwfl_elf_phdr_memory_callback is called from dwfl_link_map_report but if any issues arise, those could be addressed in a separate patch. Best, Gavin On Wed, Nov 30, 2022 at 3:14 PM Mark Wielaard <m...@klomp.org> wrote: > > Hi Gavin, > > On Tue, Nov 29, 2022 at 01:48:42PM -0800, Gavin Li wrote: > > I think for the purposes of reading small segments (like PT_DYNAMIC > > and PT_NOTE), we should ignore *buffer_available altogether. > > Thanks for walking me through the code. I think you are right and none > of the buffer_available checks are necessary. So I removed them all. I > also adjusted the commit message a bit. Could you look at this patch > and let me know if this works for you? > > Cheers, > > Mark