Merge branch 'zlo/tlsf-and-a-temple-of-memcorrupt' of https://github.com/flipperdevices/flipperzero-firmware into mntm-dev

This commit is contained in:
Willy-JL
2024-05-16 21:49:35 +01:00
21 changed files with 626 additions and 646 deletions
+1
View File
@@ -14,6 +14,7 @@ env.Append(
libs = env.BuildModules(
[
"tlsf",
"mlib",
"stm32wb",
"freertos",
+4 -4
View File
@@ -466,7 +466,7 @@ static bool elf_load_section_data(ELFFile* elf, ELFSection* section, Elf32_Shdr*
return true;
}
section->data = aligned_malloc(section_header->sh_size, section_header->sh_addralign);
section->data = aligned_alloc(section_header->sh_addralign, section_header->sh_size);
section->size = section_header->sh_size;
if(section_header->sh_type == SHT_NOBITS) {
@@ -718,7 +718,7 @@ static bool elf_relocate_fast(ELFFile* elf, ELFSection* s) {
}
}
aligned_free(s->fast_rel->data);
free(s->fast_rel->data);
free(s->fast_rel);
s->fast_rel = NULL;
@@ -785,10 +785,10 @@ void elf_file_free(ELFFile* elf) {
ELFSectionDict_next(it)) {
const ELFSectionDict_itref_t* itref = ELFSectionDict_cref(it);
if(itref->value.data) {
aligned_free(itref->value.data);
free(itref->value.data);
}
if(itref->value.fast_rel) {
aligned_free(itref->value.fast_rel->data);
free(itref->value.fast_rel->data);
free(itref->value.fast_rel);
}
free((void*)itref->key);
Submodule
+1
Submodule lib/tlsf added at 8fc595fe22
+21
View File
@@ -0,0 +1,21 @@
Import("env")
env.Append(
CPPPATH=[
"#/lib/tlsf",
],
)
libenv = env.Clone(FW_LIB_NAME="tlsf")
libenv.ApplyLibFlags()
libenv.Append(
CPPDEFINES=[],
)
sources = [File("tlsf/tlsf.c")]
lib = libenv.StaticLibrary("${FW_LIB_NAME}", sources)
libenv.Install("${LIB_DIST_DIR}", lib)
Return("lib")