Skip to content

Ability to assign a global variable to be stored in .rodata section #1244

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

Closed
gingerBill opened this issue Oct 24, 2021 · 2 comments
Closed

Comments

@gingerBill
Copy link
Member

Ability to assign a global variable to be stored in .rodata section of the executable.

This will be achieved with an attribute (name undecided yet). It will most likely make the variable private to the package too by default since that thing it will be making private will most likely only be used by the package.

An important use case for this is for security purposes, especially with the new core:crypto.

@github-actions
Copy link

Hello!

I am marking this issue as stale as it has not received any engagement from the community or maintainers 120 days. That does not imply that the issue has no merit! If you feel strongly about this issue

  • open a PR referencing and resolving the issue;
  • leave a comment on it and discuss ideas how you could contribute towards resolving it;
  • leave a comment and describe in detail why this issue is critical for your use case;
  • open a new issue with updated details and a plan on resolving the issue.

The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone..

@Tetralux
Copy link
Contributor

Tetralux commented Aug 25, 2022

This can currently be achived using:

// On Unixes:
@(link_section=".rodata")
my_global := "Hello, World"

// Or on Windows:
@(link_section=".rdata")
my_global := "Hello, World!"

However, there exists no way to just say "I want this to be read-only."
So you'd have to use some form of conditional compilation, in order to conditionally pick the section name accordingly.

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

No branches or pull requests

2 participants