Signed-off-by: Timm Bäder <tbae...@redhat.com>
---
 libdwfl/dwfl_segment_report_module.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/libdwfl/dwfl_segment_report_module.c 
b/libdwfl/dwfl_segment_report_module.c
index 76686a72..80f97cfd 100644
--- a/libdwfl/dwfl_segment_report_module.c
+++ b/libdwfl/dwfl_segment_report_module.c
@@ -948,15 +948,6 @@ dwfl_segment_report_module (Dwfl *dwfl, int ndx, const 
char *name,
       if (unlikely (contents == NULL))
        goto out;
 
-      inline void final_read (size_t offset, GElf_Addr vaddr, size_t size)
-      {
-       void *into = contents + offset;
-       size_t read_size = size;
-       (void) segment_read (dwfl, memory_callback, memory_callback_arg,
-                             addr_segndx (dwfl, segment, vaddr, false),
-                            &into, &read_size, vaddr, size);
-      }
-
       if (contiguous < file_trimmed_end)
        {
          /* We can't use the memory image verbatim as the file image.
@@ -966,7 +957,14 @@ dwfl_segment_report_module (Dwfl *dwfl, int ndx, const 
char *name,
                                 GElf_Off offset, GElf_Xword filesz)
          {
            if (type == PT_LOAD)
-             final_read (offset, vaddr + bias, filesz);
+              {
+                void *into = contents + offset;
+                size_t read_size = filesz;
+                (void)segment_read (dwfl, memory_callback, memory_callback_arg,
+                                    addr_segndx (dwfl, segment, vaddr + bias, 
false),
+                                    &into, &read_size, vaddr + bias, 
read_size);
+
+              }
          }
 
          if (ei_class == ELFCLASS32)
@@ -987,7 +985,13 @@ dwfl_segment_report_module (Dwfl *dwfl, int ndx, const 
char *name,
          memcpy (contents, buffer, have);
 
          if (have < file_trimmed_end)
-           final_read (have, start + have, file_trimmed_end - have);
+            {
+              void *into = contents + have;
+              size_t read_size = file_trimmed_end - have;
+              (void)segment_read (dwfl, memory_callback, memory_callback_arg,
+                                  addr_segndx (dwfl, segment, start + have, 
false),
+                                  &into, &read_size, start + have, read_size);
+            }
        }
 
       elf = elf_memory (contents, file_trimmed_end);
-- 
2.26.2

Reply via email to