summaryrefslogtreecommitdiff
path: root/src/format/elf
diff options
context:
space:
mode:
Diffstat (limited to 'src/format/elf')
-rw-r--r--src/format/elf/elf.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/format/elf/elf.c b/src/format/elf/elf.c
index 1ca81be..2ca3b8c 100644
--- a/src/format/elf/elf.c
+++ b/src/format/elf/elf.c
@@ -468,6 +468,7 @@ static void g_elf_format_refine_portions(GElfFormat *format)
uint16_t max; /* Décompte d'éléments traités */
uint16_t i; /* Boucle de parcours */
off_t offset; /* Début de part de programme */
+ vmpa2t origin; /* Origine d'une définition */
elf_phdr phdr; /* En-tête de programme ELF */
uint32_t p_flags; /* Droits associés à une partie*/
const char *background; /* Fond signigicatif */
@@ -506,6 +507,8 @@ static void g_elf_format_refine_portions(GElfFormat *format)
offset = ELF_HDR(format, format->header, e_phoff)
+ ELF_HDR(format, format->header, e_phentsize) * i;
+ init_vmpa(&origin, offset, VMPA_NO_VIRTUAL);
+
if (!read_elf_program_header(format, offset, &phdr))
continue;
@@ -535,7 +538,7 @@ static void g_elf_format_refine_portions(GElfFormat *format)
g_binary_portion_set_rights(new, rights);
- g_exe_format_include_portion(exe_format, new);
+ g_exe_format_include_portion(exe_format, new, &origin);
}
@@ -586,7 +589,12 @@ static void g_elf_format_refine_portions(GElfFormat *format)
g_binary_portion_set_rights(new, rights);
- g_exe_format_include_portion(exe_format, new);
+ offset = ELF_HDR(format, format->header, e_shoff)
+ + ELF_HDR(format, format->header, e_shentsize) * i;
+
+ init_vmpa(&origin, offset, VMPA_NO_VIRTUAL);
+
+ g_exe_format_include_portion(exe_format, new, &origin);
}