String terminator was added to the buffer with a list of section names
in the elf file. Added check to the section name index to make sure it
doesn't go beyond the buffer size.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
If fseek reports an error, the error code set in errno is returned.
Improved handling an error during reading from a file. Now it distinguishes
between an error reported by the fread and insufficient data in a file.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Added checking of the value returned by fseek function and added memory
release when an error is detected.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
The values assigned when declaring variables were overwritten in the code.
Redundant initialization was removed.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Before:
error: unable to open sof.elf for reading: 2
After:
error: unable to open sof.elf for reading: No such file or directory
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
SMEX (*SOF Metadata EXtractor*) is a tool used to extract needed
information from SOF source code and output files and then save
them in convenient form like logs dictionary file (*ldc*).
After full integration of SMEX with SOF build system,
rImage with no sof specific ldc generator code can be moved
outside as a common external tool.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>