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

Add documentation for linker errors around static functions and linker scripts #484

Closed
wants to merge 3 commits into from

Conversation

randomPoison
Copy link
Contributor

This (at least partially) addresses #414 and #415 by adding docs around those potential error cases. This covers the cases that I ran into working on zlib.

@randomPoison randomPoison requested a review from ayrtonm December 17, 2024 00:56
docs/usage.md Outdated
Comment on lines 301 to 303
Note also that an `__attribute__((visibility ("hidden")))` annotation can have
the same effect as hiding the symbol in a linker script. Such annotation will
have to be removed to work in a containerized app.
Copy link
Contributor

Choose a reason for hiding this comment

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

We figured out how to handle hidden symbols in #451. Though it appears #435 was then re-opened, but I forget why (@ayrtonm, do you remember?).

Copy link
Contributor

Choose a reason for hiding this comment

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

It was closed by mistake. There's some edge case we still don't support but I don't remember at the moment. IIRC adding the flag to the test suite should point it out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hrm, interesting I didn't realize we had already resolved part of this. I'm trying to reproduce the issues I'm documenting here and it seems like maybe these docs are now redundant?

  • __attribute__((used)) is now being inserted correctly for static functions when static comes from inside a macro.
  • Functions marked with __attribute__((visibility ("hidden"))) now link correctly.

I still need to test if the issue with a version script is also fixed, but if it is I think we can close this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like the fix for visibility("hidden") also addressed the issue with having a linker script mark a symbol local? Or at least the issue was fixed at some point because I can now include the zlib linker script in the compartmentalized build and I no longer hit the linker errors I originally saw. So I'm going to close this and the related bugs.

@randomPoison
Copy link
Contributor Author

The issues this PR documents no longer seem to be happening (see #484 (comment)), so I'm going to close this PR.

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.

4 participants