It was clear that hard-coded section names aren't reliable enough but
they broke down way earlier than has been expected.
This patch replaces hard-coded sections with a loop, scanning all
sections and selecting them based on their flags and types.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Always use a "raw string" for regular expressions, otherwise the
backslash is used to start Unicode escape sequences.
Fixes hopefully harmless error:
```
scripts/llext_link_helper.py:38: SyntaxWarning: invalid escape sequence '\.'
p = re.compile('(^lib|\.so$)')
```
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
When an ELF section isn't found .get_section_by_name() raises an
AttributeError exception, catch it specitically instead of catching
any exception.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Add support for relocatable objects to the llext module build system.
In such builds no ELF segments are created, so we need to process all
sections individually.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Convert the smart-amp-test in its IPC4 version to a loadable LLEXT
module. Use an overlay configuration to select between monolithic and
modular builds.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>