[FL-3486,FL-3392] fbt: various improvements and bug fixes (#2982)

* fbt: extapps: compact debug format for .faps
* fbt: sdk: fixed symbol cache regen logic for removed-only symbols
* lib: elf_file: early .fap file handle release
* fbt: extapps: added FAP_VERSION define for application environments
* github: added appsymbols artifact
* api: updates for f18
* github: fixed early fap_dist
* fbt: added flash_dap
* ufbt: added flash_dap
* fbt: reworked flash target; scripts: program.py->fwflash.py and changes
* vscode: updated configuration
* scripts: fwflash.py: ugly fixes for ufbt
* scripts: fwflash.py: cleanup
* fbt: flash: always use .elf file
* scripts: fwflash: fixed elf file path

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
hedger
2023-08-23 03:33:10 +09:00
committed by GitHub
co-authored by あく
parent 991e58e405
commit ace0901125
20 changed files with 226 additions and 206 deletions
+11 -1
View File
@@ -1,3 +1,4 @@
#include "storage/storage.h"
#include <elf.h>
#include "elf_file.h"
#include "elf_file_i.h"
@@ -57,6 +58,13 @@ static void address_cache_put(AddressCache_t cache, int symEntry, Elf32_Addr sym
/********************************************** ELF ***********************************************/
/**************************************************************************************************/
static void elf_file_maybe_release_fd(ELFFile* elf) {
if(elf->fd) {
storage_file_free(elf->fd);
elf->fd = NULL;
}
}
static ELFSection* elf_file_get_section(ELFFile* elf, const char* name) {
return ELFSectionDict_get(elf->sections, name);
}
@@ -764,7 +772,7 @@ void elf_file_free(ELFFile* elf) {
free(elf->debug_link_info.debug_link);
}
storage_file_free(elf->fd);
elf_file_maybe_release_fd(elf);
free(elf);
}
@@ -855,6 +863,7 @@ ElfProcessSectionResult elf_process_section(
}
ELFFileLoadStatus elf_file_load_sections(ELFFile* elf) {
furi_check(elf->fd != NULL);
ELFFileLoadStatus status = ELFFileLoadStatusSuccess;
ELFSectionDict_it_t it;
@@ -895,6 +904,7 @@ ELFFileLoadStatus elf_file_load_sections(ELFFile* elf) {
FURI_LOG_I(TAG, "Total size of loaded sections: %zu", total_size);
}
elf_file_maybe_release_fd(elf);
return status;
}