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

Limit exported symbols #35

Merged
merged 2 commits into from
Sep 20, 2023
Merged

Conversation

agx
Copy link
Contributor

@agx agx commented Sep 20, 2023

This greatly reduces the number of exported symbols by limiting the namespace of exported symbols to {varnam,varray,vm}_ thus avoiding the export of all the _cg symbols from go.

Before:

    $ readelf -s /usr/lib/libgovarnam.so.1.9.0  | grep -v " UND " | wc -l
    248

After:

    $ readelf -s /usr/lib/libgovarnam.so.1.9.0  | grep -v " UND " | wc -l
    52

With this we can make sure applications don't link against accidentally exported symbols and break on library upgrades without us being able to notice. It also allows us to notice when symbols go missing and we hence need to bump the ABI version.

I've put this on top of #34

This also allows us to use symbol versioning for new symbols if desired.

agx added 2 commits September 20, 2023 13:33
The merge of MR dropped `else` which made the soname setting
ineffective on Linux.
This greatly reduces the number of exported symbols by limiting the
namespace of exported symbols to {varnam,varray,vm}_ thus avoiding the
export of all the `_cg` symbols from go.

Before:

$ readelf -s /tmp/a/usr/lib/libgovarnam.so.1.9.0  | grep -v " UND " | wc -l
248

After:

$ readelf -s /usr/lib/libgovarnam.so.1.9.0  | grep -v " UND " | wc -l
52

With this we can make sure applications don't link against accidentally
exported symbols and break on library upgrades without us being able to
notice. It also allows us to notice when symbols go missing and we hence
need to bump the ABI version.
@subins2000 subins2000 merged commit 436d006 into varnamproject:master Sep 20, 2023
1 check failed
@agx
Copy link
Contributor Author

agx commented Sep 20, 2023

Thanks for merging this in so quickly!

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