ModuleX without position independent code and data

HugPeter-9392 246 Reputation points
2022-05-19T12:59:09.483+00:00

Hello
The module requirements (see https://learn.microsoft.com/en-us/azure/rtos/threadx-modules/chapter2) state that modules need to be built with position independent code and data. I understand that this is required when the module needs to be loaded/executed from a memory area that is not known at link time.

IAR documents in https://www.iar.com/knowledge/support/technical-notes/compiler/ewarm-position-independent-code-and-data-ropi-and-rwpi-ewarm-5.50/ some limitations to position independent code and data.

I wonder if building with position independent code and data is only required to be free where the module gets placed within deployment and RAM used during runtime. In other words: Can modules also be build without position independent code and data. The only difference is that the module needs to be deployed to memory where it is linked to. Additionally, the RAM area needs to be fixed at link time. This both is a matter of linker configuration.

Are there more to change other than IAR compiler code generation settings and IAR linker command file (remove 'movable' command from block definition)?

Are there other notable changes or limitation when not using position independent code and data.

Thanks for support
Peter

Azure RTOS
Azure RTOS
An Azure embedded development suite including a small but powerful operating system for resource-constrained devices.
341 questions
{count} votes

Accepted answer
  1. Scott Azure RTOS 4,051 Reputation points
    2022-05-19T20:14:41+00:00

    Our documentation hasn't been updated with this newer API, but function txm_module_manager_absolute_load is exactly what you are looking for. The module doesn't need to be built with any position independence. See example of its use in the A35 example.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.