riscv-software-src / opensbi

RISC-V Open Source Supervisor Binary Interface
Other
1.03k stars 511 forks source link

build issue - functions do not get linked #351

Closed natirapaport closed 7 months ago

natirapaport commented 7 months ago

Hello, We added some ecall extensions (ecall extensions and their respective handlers) and placed the new files not in sbi/lib path (where all other ecall handlers are) but under platform/generic/swerv (swerv is our core), as these changes are specific to our core, so that place seems the correct one for us.

The new files are compiled ok (object files are created) but "objdumping" the elf file we don't find our new functions inside. So the linker dropped them. I do aware that the functions are not being called, but all other ecall handlers in sbi/lib are not being called too and they are in the elf. These are service functions.

Could you please advice what should I set and where in order to instruct the linker not to drop those functions?

Thank you in advance!

natirapaport commented 7 months ago

I found the way to do it