Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Position Independent Code #322

Closed
noonien opened this issue Apr 2, 2021 · 2 comments
Closed

Position Independent Code #322

noonien opened this issue Apr 2, 2021 · 2 comments

Comments

@noonien
Copy link

noonien commented Apr 2, 2021

Hello!

From what I can gather, cortex-m-rt doesn't currently support being compiled with position independent code.

I would like to have multiple applications on the flash, and have the bootloader chooses which one to run by just changing the VTOR.

Is it possible to have this work?

@adamgreig
Copy link
Member

Unfortunately Rust doesn't really support this for the thumb targets yet; there's some more info here:

It might work for some limited applications if vtables and perhaps statics weren't used, but in general it's not currently supported. You could possibly imagine the bootloader doing some runtime patching or moving code around to make it work, but it wouldn't be simple.

@noonien
Copy link
Author

noonien commented Apr 2, 2021

I see, thanks for the links!
I'll follow rust-lang/rust#54431.

@noonien noonien closed this as completed Apr 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants