Thursday, 8 August 2013

hiding the visibility of symbols from shared library

hiding the visibility of symbols from shared library

While working with gcc 4.5.3 , i had lot of symbols exposed in final
shared library so i added
ifdef ANDROID
define SHADER_IMPORT_EXPORT attribute ((visibility ("default")))
and in make file added few options
** -fvisibility=hidden \
-fvisibility-inlines-hidden \ **
even after this i see lot of symbols
7369: 007687f0 28 FUNC WEAK DEFAULT 11 ZNK9_gnu_cxx17_normal
7370: 003affc0 52 FUNC WEAK DEFAULT 11 _ZNSt8_Rb_treeISt4pairIPK
in order to get rid of these symbols visibility , i added one more option
-fno-weak
after doing this the WEAK symbols are not shown but when running the final
image on target getting undefined symbol error from map files for these
WEAK symbols.
os_map error: /usr/lib/lib-ax.so: undefined symbol: ZNK9_gnu_cxx17_normal
, on '/usr/lib/el/ES2.so'
These weak symbols should not be exposed then why even using hidden option
these are exposed?
is there some other way to hide these symbols and avoid undefined symbol
error from map files.

No comments:

Post a Comment