Merge pull request #103 from w0xel/hotfix/rodata2-init-array-section

elf32.c: Extract and flash INIT_ARRAY sections
This commit is contained in:
Daniel Beer 2021-03-11 11:57:12 +13:00 committed by GitHub
commit 66dd71e62d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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++) { for (i = 0; i < info.file_ehdr.e_shnum; i++) {
Elf32_Shdr *s = &info.file_shdrs[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) { feed_section(&info, in, s, cb, user_data) < 0) {
ret = -1; ret = -1;
break; break;