From: "Jan Beulich" Subject: Re: [RFC v2] xSplice design Date: Mon, 08 Jun 2015 09:51:06 +0100 Message-ID: <5575739A0200007800081D8E@mail.emea.novell.com> References: <20150515194440.GA24313@l.oracle.com> <555CA418.6080707@amazon.com> <20150605150029.GC10207@l.oracle.com> <5571DBE602000078000817AA@mail.emea.novell.com> <557553A4.5000104@amazon.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z1sm1-0002eW-FO for xen-devel@lists.xenproject.org; Mon, 08 Jun 2015 08:51:13 +0000 In-Reply-To: <557553A4.5000104@amazon.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Martin Pohlack Cc: Elena Ufimtseva , jeremy@goop.org, hanweidong@huawei.com, john.liuqiming@huawei.com, Paul Voccio , xen-devel@lists.xenproject.org, Daniel Kiper , Major Hayden , liuyingdong@huawei.com, aliguori@amazon.com, konrad@darnok.org, lars.kurth@citrix.com, Steven Wilson , peter.huangpeng@huawei.com, msw@amazon.com, xiantao.zxt@alibaba-inc.com, Rick Harris , boris.ostrovsky@oracle.com, Josh Kearney , jinsong.liu@alibaba-inc.com, Antony Messerli , fanhenglong@huawei.com, andrew.cooper3@citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 08.06.15 at 10:34, wrote: > On 05.06.2015 17:27, Jan Beulich wrote: >>>>> On 05.06.15 at 17:00, wrote: >>> On Wed, May 20, 2015 at 05:11:20PM +0200, Martin Pohlack wrote: >>>> * Xen as it is now, has a couple of non-unique symbol names which will >>>> make runtime symbol identification hard. Sometimes, static symbols >>>> simply have the same name in C files, sometimes such symbols get >>>> included via header files, and some C files are also compiled >>>> multiple times and linked under different names (guest_walk.c). I >>>> think the Linux kernel solves this by aiming at unique symbol names >>>> even for local symbols. >>>> >>>> nm xen-syms | cut -f3- -d\ | sort | uniq -c | sort -nr | head >>> >>> Oh my. Looks like a couple of prepartion patches will be in order! >> >> Just because nm doesn't express this doesn't mean we have to >> special case them: In ELF (and in COFF too, which is relevant as >> long as xen.efi still remains to be a separate binary) static symbols >> can easily be qualified by their source or object file name - the >> symbol table certainly has that information available. As said on >> the hackathon, our current kallsyms mechanism - using nm output - >> suffers from this too, yet I personally view it as rather bad practice >> to add a globally unique prefix to local symbol names. Instead, as >> also said there, we should switch to consuming the full ELF symbol >> table. That's been on my todo list for two years or more - if only I >> would ever get the time to do things like that... > > Hmm, in my experience, you have file-type symbols in the symbol table > that refer to source-code files and you have source-file references in > the dwarf debug information. > > I have *not* seen references to object-files in either place The linker can insert such. But the case likely isn't of interest in our scenario anyway. > and as some > C-files are compiled multiple times in Xen (guest_walk.c), the mapping > is not unique. And I suppose there are always going to be cases where manual intervention is required. All we can aim for is making as little of such necessary as possible. > Further, as soon as non-trivial linker scripts are used, the symbol > ordering in the final xen-syms does not necessarily reflect original > object-file contents anymore. But the linker should ensure that static symbols don't lose their association with the respective STT_FILE symbol. Jan