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

Reduce symbol exposure #9

Merged
merged 1 commit into from
Mar 16, 2018
Merged

Conversation

jserv
Copy link
Member

@jserv jserv commented Mar 16, 2018

When creating an ELF shared object (by convention, a file named as
lib*.so), all symbols are marked as public, hence included in the
object's export symbol table. This commit reduces exported symbol
by marking proper 'static'.

[old]
$ size build/libdcurl.so
text data bss dec hex filename
16752 924 160 17836 45ac build/libdcurl.so

[new]
size build/libdcurl.so
text data bss dec hex filename
15936 836 168 16940 422c build/libdcurl.so

TODO: there are various way to control over symbol exports in GCC:

  • compiler flag -fvisibility=hidden
  • Using `ld' linker version script
    Once we confirm consistent API naming scheme, we can then apply these
    techniques.

When creating an ELF shared object (by convention, a file named as
lib*.so), all symbols are marked as public, hence included in the
object's export symbol table. This commit reduces exported symbol
by marking proper 'static'.

[old]
$ size build/libdcurl.so
   text    data     bss     dec     hex filename
  16752     924     160   17836    45ac build/libdcurl.so

[new]
size build/libdcurl.so
   text    data     bss     dec     hex filename
  15936     836     168   16940    422c build/libdcurl.so

TODO: there are various way to control over symbol exports in GCC:
  * compiler flag -fvisibility=hidden
  * Using `ld' linker version script
Once we confirm consistent API naming scheme, we can then apply these
techniques.
@furuame furuame merged commit 0325cb5 into DLTcollab:dev Mar 16, 2018
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.

None yet

2 participants