summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/elf/section.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/plugins/elf/section.c b/plugins/elf/section.c
index 0e2fd3e..0758693 100644
--- a/plugins/elf/section.c
+++ b/plugins/elf/section.c
@@ -202,8 +202,21 @@ void get_elf_section_content(const GElfFormat *format, const elf_shdr *section,
*size = ELF_SHDR(format, *section, sh_size);
if (addr != NULL)
+ {
*addr = ELF_SHDR(format, *section, sh_addr);
+ if (*addr == 0)
+ {
+ if (ELF_HDR(format, format->header, e_type) == ET_REL
+ || (ELF_SHDR(format, *section, sh_flags) & SHF_ALLOC) == 0)
+ {
+ *addr = VMPA_NO_VIRTUAL;
+ }
+
+ }
+
+ }
+
}
@@ -229,7 +242,14 @@ void get_elf_section_range(const GElfFormat *format, const elf_shdr *section, mr
virt = ELF_SHDR(format, *section, sh_addr);
if (virt == 0)
- virt = VMPA_NO_VIRTUAL;
+ {
+ if (ELF_HDR(format, format->header, e_type) == ET_REL
+ || (ELF_SHDR(format, *section, sh_flags) & SHF_ALLOC) == 0)
+ {
+ virt = VMPA_NO_VIRTUAL;
+ }
+
+ }
init_vmpa(&tmp, ELF_SHDR(format, *section, sh_offset), virt);