llext: relocate all symbols regardless of type

In the current implementation, the LLEXT linker will only apply
relocations targeting a given symbol if it has a specfic symbol type.
This is overzealous and causes issues on some platforms, as some symbols
that need to be relocated are skipped due to being of a "bad" type.

Ignore the symbol type when performing relocation to solve this problem,
but also add checks to ensure we don't attempt to relocate symbols with
an invalid section index. If such a relocation is found, return an error
instead of ignoring the relocation entry to ensure that it is impossible
to execute code from a (partially) unrelocated LLEXT.

Also remove all hacks added to circumvent this issue:
* qemu_cortex_r5 exclusion from test cases
* unnecessary exclusion of some flags when building with LLEXT EDK

Fixes #72832.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
This commit is contained in:
Mathieu Choplain 2024-05-28 18:13:02 +02:00 committed by Maureen Helm
commit a07d493c9d
4 changed files with 30 additions and 18 deletions

View file

@ -7,7 +7,6 @@ common:
- apollo4p_evb
- apollo4p_blue_kxr_evb
- numaker_pfm_m487 # See #63167
- qemu_cortex_r5 # unsupported relocations
tests:
# While there is in practice no value in compiling subsys/llext/*.c