Skip to content
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

shell: change XFA format for !20958 #134

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maribu
Copy link
Member

@maribu maribu commented Nov 6, 2024

src/shell/mod.rs Outdated
Comment on lines 436 to 437
#[link_section = ".roxfa.shell_commands_xfa.5"]
#[export_name = concat!("shell_commands_xfa_5_", stringify!($modname))]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this backward compatible would probably require some cooperation from RIOT. I guess changing the XFA section name (e.g. from .roxfa.shell_commands_xfa.5 to .roxfa.shell_commands_v2_xfa.5) and providing both ptr and element would work, assuming that the linker would garbage collect the ptr in the newer version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems to indeed just work

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The garbage collection does not work here, so while this does allow adding shell commands in a way that works with both pre and post !20958 RIOT, it will not reduce the overhead.

I guess this is acceptable mid-term? We could drop the ptr for backward compatibility in the long run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant