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

[PATCH] Private symbols exported from shared library #195

Closed
yugr opened this issue Apr 25, 2018 · 5 comments
Closed

[PATCH] Private symbols exported from shared library #195

yugr opened this issue Apr 25, 2018 · 5 comments

Comments

@yugr
Copy link
Contributor

yugr commented Apr 25, 2018

Expat currently exports several private symbols which are not mentioned in public headers and thus should not be used by clients:

__bss_start
_edata
_fini
_init
XmlGetUtf16InternalEncoding  
XmlGetUtf16InternalEncodingNS
XmlGetUtf8InternalEncoding   
XmlGetUtf8InternalEncodingNS 
XmlInitEncoding              
XmlInitEncodingNS            
XmlInitUnknownEncoding       
XmlInitUnknownEncodingNS     
XmlParseXmlDecl                 
XmlParseXmlDeclNS               
XmlPrologStateInit              
XmlPrologStateInitExternalEntity
XmlSizeOfUnknownEncoding
XmlSizeOfUnknownEncoding

Removing these symbols would allow compiler to optimize code more aggressively, speed up dynamic linker on Linux and prevent clients from inadverently using internal APIs.

I attached a simple patch that hides private symbols. It passes make check (I can do additional testing if needed). Would something like this be interesting for the project?

0001-Hide-private-symbols.patch.txt

The issue was found using ShlibVisibilityChecker.

@hartwork hartwork changed the title Private symbols exported from shared library [PATCH] Private symbols exported from shared library Apr 25, 2018
@hartwork
Copy link
Member

Hi Yury, I still need to have a closer look. For a first quick reply: Yes, this issue is worth fixing.

@yugr
Copy link
Contributor Author

yugr commented May 9, 2018

Hi Sebastian, I've attached a slightly updated version (removes same symbols). Let me know if additional testing is needed (besides make check).

0001-Hide-private-symbols-v2.patch.txt

This was referenced May 22, 2018
@yugr
Copy link
Contributor Author

yugr commented Sep 3, 2018

A friendly reminder.

@marcomaggi
Copy link
Contributor

Maybe preparing a proper pull request would make things easier for everyone?

@yugr
Copy link
Contributor Author

yugr commented Sep 5, 2018

@marcomaggi There is GH-197...

@hartwork hartwork added this to the 2.3.0 milestone Sep 20, 2018
@hartwork hartwork modified the milestones: 2.3.0, 2.2.7 Apr 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants