[Tarantool-patches] [PATCH 00/43] Unhide symbols

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Tue Apr 14 00:01:18 MSK 2020



On 13/04/2020 21:49, Sergey Ostanevich wrote:
> Hi, Vlad! 
> 
> Thanks for the patch, still I've got a question:
> 
>>>> It also adds explicit -Wl,exported_symbols_list
>>>
>>> Basically the right fix is to remove this link option, not come up
>>> with 43 patches.
>>
>> It is not enough. Static library symbols are not exported, if they
>> are not used. Linker drops them. It means almost all needed symbols
>> are removed when you just remove the option.
> 
> If those symbols are removed, does it mean they're not used in the
> product? Why one (even Mons!) will need to call a function, that is not
> a part of the product then?

If a function is not used in the final executable, it does not mean
it is legal to remove it. Some of such functions still should be
visible in case a dynamic user-implemented module will be loaded at
runtime. These are mostly wrappers around private functions, which
do a little more error checking.

On the summary, there are 3 groups of exported symbols:

- Needed for dynamically loaded modules for the public C API;

- Needed for our own Lua code to use via FFI;

- Other symbols, which are not public, and are not needed for
  Lua FFI. Typically these are all non inlined functions used in
  the final executable in one way or another. These are highly
  unstable, can be renamed, removed.

Mons wants to use the third group.

Talking of your question 'Why would he want to use them?' - I don't
know. I don't like that either. But it was discussed already millions
of times. At 1000001th time Kirill decided to surrender, the ticket
was assigned on a milestone and given to me, and so it is implemented.

> Regards,
> Sergos
> 


More information about the Tarantool-patches mailing list