-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
llext: fix RISC-V inspection tests #85989
Conversation
RISC-V uses ".s"-prefixed sections for variables less than 8 bytes. The hardcoded sections used in the inspect test were thus not matching the compiled binary, causing the test to fail. Fix this by using the correct section names for RISC-V. Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Actually, I think it is better to disable the use of .sbss/.sdata: In case an llext uses both .sbss and .bss, there are two non-skipped NOBITS sections. |
@WorldofJARcraft thanks for pointing that out. Maybe we could fix that instead (if they appear close together, it's an easy fix) and keep the sections? Have no experience with RISC-V, does that layout provide a significant speed benefit? |
The compiler moves small global symbols such as scalar integers (with a size below a configurable threshold) into the .srodata/.sdata/.sbss sections. All other (larger) globals go into .rodata/.data/.bss, respectively. |
One more thing: the compiler does not generate GP-relative accesses itself - this is implemented as a linker relaxation, which needs to be explicitly enabled ( |
I see, thank you very much for the explanations. No need to go that far then, so I will close this. (Also, for posterity, looked into multiple NOBITS sections and it's doable but non-trivial for shared objects). |
RISC-V uses ".s"-prefixed sections for variables less than 8 bytes. The hardcoded sections used in the inspect test were thus not matching the compiled binary, causing the test to fail.
Fix this by using the correct section names for RISC-V.