[FFmpeg-devel] Visibility implementation

matthieu castet castet.matthieu
Thu Jul 31 21:46:32 CEST 2008


Michael Niedermayer wrote:
> On Thu, Jul 31, 2008 at 08:03:50PM +0300, Uoti Urpala wrote:
>> On Wed, 2008-07-30 at 05:45 +0300, Uoti Urpala wrote:
>>> The attached patch adds visibility information for lots of symbols in
>>
>> Does anyone have comments about the substance of the patch (something
>> more than M?ns's general hostility towards visibility)?
It can help to do smaller shared library (I am not sure if the 
visibility stuff hide all internal symbol). But that's a start.


$ ./configure --enable-shared --extra-cflags="-ffunction-sections 
-fdata-sections" --extra-ldflags="-Wl,--gc-sections 
-Wl,--print-gc-sections" --disable-decoders --disable-encoders 
--disable-muxers
$size */*.so
    text    data     bss     dec     hex filename
1164633    3576   32556 1200765  12527d libavcodec/libavcodec.so
   20334     652      12   20998    5206 libavdevice/libavdevice.so
  481499    9144      32  490675   77cb3 libavformat/libavformat.so
   41078     300   13876   55254    d7d6 libavutil/libavutil.so
    8155     388       8    8551    2167 vhook/drawtext.so
    7135     384      16    7535    1d6f vhook/fish.so
    2464     316       8    2788     ae4 vhook/null.so
    5001     376       8    5385    1509 vhook/ppm.so
    8026     384       8    8418    20e2 vhook/watermark.so

$ ./configure --enable-shared --disable-decoders --disable-encoders 
--disable-muxers
$size */*.so                                text    data     bss     dec 
     hex filename
1270473    3768  545612 1819853  1bc4cd libavcodec/libavcodec.so
   20334     652      12   20998    5206 libavdevice/libavdevice.so
  481643    9144      32  490819   77d43 libavformat/libavformat.so
   41078     300   13876   55254    d7d6 libavutil/libavutil.so
    8155     388       8    8551    2167 vhook/drawtext.so
    7135     384      16    7535    1d6f vhook/fish.so
    2464     316       8    2788     ae4 vhook/null.so
    5001     376       8    5385    1509 vhook/ppm.so
    8026     384       8    8418    20e2 vhook/watermark.so

> 
> I have no technical objections to the patch, it does make -fPIC code faster,
> smaller and i suspect improves linking times.
> A technical objection would be if i knew a better solution but i do not,
> at least not with current gcc. If its -visibility=hidden was a little smarter,
> that is mark all symbols hidden unless they are in a header under /usr/...
> then all this could be done much nicer.
Or use the difference between include <...> and include "..."

Matthieu




More information about the ffmpeg-devel mailing list