From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp39.i.mail.ru (smtp39.i.mail.ru [94.100.177.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 33E6E4696C3 for ; Tue, 14 Apr 2020 00:01:21 +0300 (MSK) References: <20200412113423.GA28681@atlas> <84069240-b5a4-9e61-09f4-a347fe53d54c@tarantool.org> <20200413094004.GB16266@atlas> <20200413094230.GC16266@atlas> <533bd68c-4bbb-446a-6265-da4f47d451f1@tarantool.org> <20200413194931.GB1734@tarantool.org> From: Vladislav Shpilevoy Message-ID: <8b7bcee8-b2db-8f2c-d241-687f6b6d6f4b@tarantool.org> Date: Mon, 13 Apr 2020 23:01:18 +0200 MIME-Version: 1.0 In-Reply-To: <20200413194931.GB1734@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 00/43] Unhide symbols List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org 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 >