-fvisibility=hidden

Дилян Палаузов dilyan.palauzov at aegee.org
Wed Jul 18 16:46:29 EDT 2012


Hello,

On 16.07.2012 02:08, Greg Banks wrote:
>
> So, remind me again what actual value we're getting from this -fvisibility=hidden stuff again?
>

Initially, libcyrus_sieve had a lot of exported symbols generated by 
bison and flex.  When libcyrus_sieve was loaded by the dynamic linker 
the list of exported symbols (section .dynsyms) was long, so finding the 
needed symbol by the dynamic linker was supposed to take long time. 
Annotating in libcyrus_sieve (and the other libraries) the 
functions/symbols with EXPORTED, that are needed outside the library, 
and compiling with -fvisibility=hidden, keeps the list of exported 
symbols short, so the dynamic linker can load the library faster.  On 
the other side the resulting library is smaller.  In addition, I think 
this makes things easier to maintain, as it is clear, if a function is 
used outside the library (EXPORTED), only within the library (HIDDEN), 
or only within the source file, it is defined (static)

Compiling different Automake targets with different CPPFLAGS/CFLAGS 
creates .o files with very long names, when the non standarf AM_CFLAGS 
are used.  The reason for the long name is, that Automake assumes, that 
a file can be compiled once with the non-standard (not Makefile.am-wide) 
CFLAGS, and once with AM_CFLAGS, so Automake reserves its right to 
create different .o files from the same .c file.  this could be avoided, 
if -fvisibility=hidden is used not only for libraries but also for 
executables and is put in AM_CFLAGS.

Greetings
   Dilian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dilyan_palauzov.vcf
Type: text/x-vcard
Size: 380 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/cyrus-devel/attachments/20120718/334dd43b/attachment.vcf 


More information about the Cyrus-devel mailing list