[FFmpeg-devel] [PATCH 1/2] libavutil: Add av_visibility_hidden for setting hidden symbol visibility

Martin Storsjö martin at martin.st
Tue Jul 12 00:42:32 EEST 2022


On Tue, 12 Jul 2022, Martin Storsjö wrote:

> On Mon, 11 Jul 2022, Henrik Gramner wrote:
>
>> On Mon, Jul 11, 2022 at 11:19 AM Martin Storsjö <martin at martin.st> wrote:
>>> +#if (AV_GCC_VERSION_AT_LEAST(4,0) || defined(__clang__)) && 
>>> (defined(__ELF__) || defined(__MACH__))
>>> +#    define av_visibility_hidden __attribute__((visibility("hidden")))
>>> +#else
>>> +#    define av_visibility_hidden
>>> +#endif
>> 
>> The usual approach is to compile with -fvisibility=hidden and
>> explicitly flag exported API symbols.
>> 
>> Is there a reason for doing this the other way around?
>
> Personally - primarily because that's way much more effort than I can put up 
> right now, while this fixes the aarch64 text relocation issue (only) with 
> fairly little effort.

... but I do kinda agree that that would be the ideal end form of the 
code. But Andreas point about that not getting the advantage for code 
referencing other hidden variables still stands though.

// Martin


More information about the ffmpeg-devel mailing list