libnvme: annotate public API symbols with __public#3199
Open
martin-belanger wants to merge 1 commit intolinux-nvme:masterfrom
Open
libnvme: annotate public API symbols with __public#3199martin-belanger wants to merge 1 commit intolinux-nvme:masterfrom
martin-belanger wants to merge 1 commit intolinux-nvme:masterfrom
Conversation
1136fec to
99d0290
Compare
Add compiler_attributes.h defining two GCC visibility macros:
__public (__attribute__((visibility("default"))))
__weak (__attribute__((weak)))
Annotate all functions exported via libnvme.ld, libnvmf.ld, and
accessors.ld with __public. This prepares libnvme for builds with
-fvisibility=hidden, ensuring internal symbols are hidden by default
and only explicitly annotated functions form the public ABI.
Each affected .c file now includes compiler_attributes.h and marks
the relevant function definitions with __public. The accessor generator
has also been updated to emit __public, so future regenerations remain
consistent.
As a small related cleanup, __weak was introduced in
compiler_attributes.h and applied where needed. While not strictly part
of the main change, it naturally fits alongside the new attribute
definitions and keeps related compiler annotations consolidated.
Signed-off-by: Martin Belanger <martin.belanger@dell.com>
99d0290 to
5884293
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
compiler_attributes.hdefining two GCC visibility macros:Annotate all functions exported via
libnvme.ld,libnvmf.ld, andaccessors.ldwith__public. This prepares libnvme for builds with-fvisibility=hidden, ensuring internal symbols are hidden by default and only explicitly annotated functions form the public ABI.Each affected
.cfile now includescompiler_attributes.hand marks the relevant function definitions with__public. The accessor generator has also been updated to emit__public, so future regenerations remain consistent.As a small related cleanup,
__weakwas introduced incompiler_attributes.hand applied where needed. While not strictly part of the main change, it naturally fits alongside the new attribute definitions and keeps related compiler annotations consolidated.