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

Explicit linking behavior #38

Merged
merged 2 commits into from
Nov 1, 2024
Merged

Explicit linking behavior #38

merged 2 commits into from
Nov 1, 2024

Conversation

MattCatz
Copy link
Contributor

@MattCatz MattCatz commented Oct 29, 2024

Previously mdio relied on GNU ld's well known secret formula finding the beginning and end of sections. Compiling with LTO and optimizations seems to break that.

Now there is a linker script that explains to the linker what is happening. used was also added to make sure the cmd functions do not get optimized away since they are not directly referenced from main (might be unnecessary).

Addresses #37
Testing locally seems like everything still works as expected. Let me know if it needs any changes.

Previously mdio relied on GNU `ld`'s well known secret formula
finding the beginning and end of sections. Compiling with LTO and
optimizations seems to break that.

Now there is a linker script that explains to the linker what is
happening. `externally_visible` was also added to make sure the
cmd functions do not get optimized away since they are not directly
referenced from `main` (might be unnecessary).
@MattCatz
Copy link
Contributor Author

@wkz wkz merged commit 6f35cdb into wkz:master Nov 1, 2024
2 checks passed
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.

2 participants