From 1633ed504a0eb9bca6a4d4370b94dc56bccb5c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20W=C3=BCrl?= Date: Mon, 8 Mar 2021 12:57:05 +0100 Subject: [PATCH] elf32.c: Extract and flash INIT_ARRAY sections --- formats/elf32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/formats/elf32.c b/formats/elf32.c index 83bbf0a..49a073c 100644 --- a/formats/elf32.c +++ b/formats/elf32.c @@ -330,7 +330,8 @@ int elf32_extract(FILE *in, binfile_imgcb_t cb, void *user_data) for (i = 0; i < info.file_ehdr.e_shnum; i++) { Elf32_Shdr *s = &info.file_shdrs[i]; - if (s->sh_type == SHT_PROGBITS && s->sh_flags & SHF_ALLOC && + if ((s->sh_type == SHT_PROGBITS || s->sh_type == SHT_INIT_ARRAY) && + s->sh_flags & SHF_ALLOC && feed_section(&info, in, s, cb, user_data) < 0) { ret = -1; break;