os/binfmt/libelf: Elf load failed for compressed binaries from smartfs
Not able to run the compressed loadable apps, when fetching from
smartfs. Due to invalid seek for compressed binaries, elf_read
failed to load the binaries.
@@ -105,6 +105,7 @@ static off_t elf_cache_lseek_block(int filfd, uint16_t binary_header_size, int b
actual_offset = binary_header_size + block_number * cache_blocks_size;
+#ifndef CONFIG_COMPRESSED_BINARY
/* Seek to location of this block in actual ELF file */
rpos = lseek(filfd, actual_offset, SEEK_SET);
@@ -116,6 +117,10 @@ static off_t elf_cache_lseek_block(int filfd, uint16_t binary_header_size, int b
return -errval;
}
+#else
+ rpos = actual_offset;
+#endif
+
return rpos;
}
