[Ffmpeg-devel] [PATCH] [Visibility] libpostproc public functions

Diego 'Flameeyes' Pettenò flameeyes
Tue Sep 19 06:52:32 CEST 2006


On Tuesday 19 September 2006 02:24, Michael Niedermayer wrote:
> why not protected?
Okay, let's see what I can take out of this question now after some hours of 
tests:

 - when using protected for the exported functions, they get bound directly in 
the library they are exported from, which means lower binding time (yai!);
 - it requires to change the export attribute from protected to default when 
the includes are used outside the library, for libavutil, this is easily 
feasible as BUILD_AVUTIL define is already present;
 - it seems to disallow taking the address of the function from inside the 
library itself:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: 
utils.o: relocation R_X86_64_PC32 against protected function 
`avcodec_default_get_buffer' can not be used when making a shared object
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: 
final link failed: Bad value

I counted at least the functions avcodec_default_get_buffer, 
avcodec_default_reget_buffer, avcodec_default_reget_buffer and 
avcodec_default_get_format being used only to get their address.
There are two ways to work this around: the first is to mark those functions 
static in utils.c unit (as they get used only there), but this will drop them 
out of the ABI; the second is to export them properly with default 
visibility, it will work, but it will require a bit fiddling to get them 
right; I think I can do this if required.

I think I'll try to get some sleep before finishing this work, because I'm 
likely to get less precise after a day without sleeping ^_^

-- 
Diego "Flameeyes" Petten? - http://farragut.flameeyes.is-a-geek.org/
Gentoo/Alt lead, Gentoo/FreeBSD, Video, AMD64, Sound, PAM, KDE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060919/723ab8d5/attachment.pgp>



More information about the ffmpeg-devel mailing list