Specifying 0 address for .module section results in few GB binary file.
Instead, put .module section near .text or .rodata.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Loadable modules are linked, using a linked script, built by a cmake
script. That linker script includes multiple existing linker script
fragments. Each of those fragments defines 1 or more sections and
respective PHDRs. However, some of those scripts, e.g.
common_rodata_linker_script.txt and data_linker_script.txt add
sections to the same rodata_phdr PHDR. This makes the linker
allocate sections in that PHDR twice in the resulting output file:
one copy is real and the other one is filled with zeros. Removing
one of the PHDR definitions solves the problem and removes about
60KiB of empty space from the output file.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
At the beginning of the .text section there must be a structure containing
information about the version of the api used by the library. It's absence
will cause sof to interpret a random literal as a version and incorrectly
load a library.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
The .module section contains the module manifest read by rimage. It should
not be included in the final loadable module image. Flags of this section
are now modified using objcopy to ignore it by rimage.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
The .data and .rodata sections are placed by rimage into one segment of
a resulting firmware image. So aligning the .rodata section to the page
boundary is just a waste of memory.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
This commit adds a necessary symbols in the linker script which allows use
a memory allocation functions from libc (malloc, calloc, etc.) in loadable
modules.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Initial commit with set of cmake and linker scripts to build loadable
modules binary.
Things yet TODO:
add all necessary Dev Kit header files to include dir,
replace dummy example with somewhat useful module example.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>