diff options
Diffstat (limited to 'src/format/elf')
-rw-r--r-- | src/format/elf/elf.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/format/elf/elf.c b/src/format/elf/elf.c index 50df077..ea1f1ff 100644 --- a/src/format/elf/elf.c +++ b/src/format/elf/elf.c @@ -76,7 +76,7 @@ static bool g_elf_format_translate_offset_into_vmpa(const GElfFormat *, phys_t, static bool g_elf_format_translate_address_into_vmpa(const GElfFormat *, virt_t, vmpa2t *); /* Fournit l'emplacement d'une section donnée. */ -bool g_elf_format_get_section_range_by_name(const GElfFormat *, const char *, mrange_t *); +static bool g_elf_format_get_section_range_by_name(const GElfFormat *, const char *, mrange_t *); @@ -149,6 +149,9 @@ static void g_elf_format_class_init(GElfFormatClass *klass) exe = G_EXE_FORMAT_CLASS(klass); + exe->get_machine = (get_target_machine_fc)g_elf_format_get_target_machine; + exe->refine_portions = (refine_portions_fc)g_elf_format_refine_portions; + exe->translate_phys = (translate_phys_fc)g_elf_format_translate_offset_into_vmpa; exe->translate_virt = (translate_virt_fc)g_elf_format_translate_address_into_vmpa; @@ -171,12 +174,6 @@ static void g_elf_format_class_init(GElfFormatClass *klass) static void g_elf_format_init(GElfFormat *format) { - GExeFormat *exe_format; /* Format parent à constituer */ - - exe_format = G_EXE_FORMAT(format); - - exe_format->get_machine = (get_target_machine_fc)g_elf_format_get_target_machine; - exe_format->refine_portions = (refine_portions_fc)g_elf_format_refine_portions; } @@ -393,9 +390,9 @@ static void g_elf_format_refine_portions(const GElfFormat *format, GBinPortion * new = g_binary_portion_new(background); - sprintf(desc, "%s \"%s\"", - _("Segment"), - get_elf_program_type_desc(ELF_PHDR(format, phdr, p_type))); + snprintf(desc, MAX_PORTION_DESC, "%s \"%s\"", + _("Segment"), + get_elf_program_type_desc(ELF_PHDR(format, phdr, p_type))); g_binary_portion_set_desc(new, desc); @@ -532,7 +529,7 @@ static bool g_elf_format_translate_address_into_vmpa(const GElfFormat *format, v * * ******************************************************************************/ -bool g_elf_format_get_section_range_by_name(const GElfFormat *format, const char *name, mrange_t *range) +static bool g_elf_format_get_section_range_by_name(const GElfFormat *format, const char *name, mrange_t *range) { bool result; /* Bilan à retourner */ phys_t offset; /* Position physique de section*/ |