Received: by 10.223.185.116 with SMTP id b49csp4812584wrg; Wed, 7 Mar 2018 01:10:31 -0800 (PST) X-Google-Smtp-Source: AG47ELs01HtZoOtmdlbkbvdFln4rPhWTznbjNAgobu51FNEFxXyNPB1e9DuvNUA0WpayZOC9GxWU X-Received: by 2002:a17:902:529:: with SMTP id 38-v6mr19324162plf.327.1520413831256; Wed, 07 Mar 2018 01:10:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520413831; cv=none; d=google.com; s=arc-20160816; b=RnMy7qSNBPCtKTFpDL9eaNOro5ewbccg3TTWL65LAUQZSgETfmPdNumra6ONO/rwBb ATHNdo4TjplwmUsAbwvIzkcYOM9RI17WuihHvYIZ5rjaKpgBU6rZiloKfvQCbxwVTtAp w9Qi9NyyALK/V2RN4yju4OtCiUgLCIQRQGRUoC1sZxjPaTTwEQ6wqiaq9VAQWYCxsmRs idD2m//5FDZddQVyU+v9olPCo7eG5IsvT69Wd+jVVNGN0V9L9jy1GjsDgnzlvikcl2+n Z9cGc880xZK2RAZVjL4v+jR0yM9Uf+FrKJbo0MaaGUz79v5lHuJeGW9zDDFQ1PD3dAOA rGJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=HIf46GDibEcSqi3jXvc+JUs5Z+9eM6fLAnwgnqwxmfE=; b=Qn5WNu0EDf5EgmX0+MhRG+2lmRtCxJtr+F7sKw1rBy9qgn9qim7/3KUaoo/1N5yBSN /ol4zdAYals/lS/aEm5stVd48Vtwr2jC/ex6YXiRAIcFMK3Q026f10suHz4S9xLdQ+MX mRIDMQKIxq6ingEkkSf+dvhG2qCNI3m5APz2NI9ocaAUa2k7giwkbVpaX9zZXrRVFLe8 GFL0grZCCvjcH/PirtUsZ3oxYVBRVx3of4SyNfYLLZABt78UYjExovdN/RqSJ5RIdFTQ 0CzRVTmYysYYxzEmC1l/RuPnHrZUIOuOrxX/gjsLJpvnZI6kJtrhshrs0ytjoEtXMrd0 eiEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1si11027902pgv.234.2018.03.07.01.10.16; Wed, 07 Mar 2018 01:10:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751130AbeCGJJV (ORCPT + 99 others); Wed, 7 Mar 2018 04:09:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:55486 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751011AbeCGJJT (ORCPT ); Wed, 7 Mar 2018 04:09:19 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 88514AD38; Wed, 7 Mar 2018 09:09:18 +0000 (UTC) Date: Wed, 7 Mar 2018 10:09:17 +0100 From: Petr Mladek To: Arnd Bergmann Cc: Sergey Senozhatsky , Tejun Heo , Steven Rostedt , Dave Young , Andi Kleen , Greentime Hu , Vincent Chen , Peter Zijlstra , Andrew Morton , Stephen Rothwell , adi-buildroot-devel@lists.sourceforge.net, Linux Kernel Mailing List , Sergey Senozhatsky Subject: Re: [PATCH] dump_stack: convert generic dump_stack into a weak symbol Message-ID: <20180307090917.2xqifk2wpk5ty36j@pathway.suse.cz> References: <20180305053742.9149-1-sergey.senozhatsky@gmail.com> <20180307022127.GB802@jagdpanzerIV> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ah, there was a mid-air collision. Arnd already answered most of my questions and even more. On Wed 2018-03-07 09:46:27, Arnd Bergmann wrote: > On Wed, Mar 7, 2018 at 3:21 AM, Sergey Senozhatsky > wrote: > > On (03/06/18 14:27), Arnd Bergmann wrote: > >> Weak symbols are generally discouraged in the kernel. We have > >> them in a couple of places, but I find them rather confusing as they > >> make it harder to figure out what is actually going on. > > > > Honestly, I kind of find __weak less confusing than EXPORT_SYMBOL(dump_stack) > > in 3 different places. __weak hints that the symbol likely will be overridden > > somewhere, while EXPORT_SYMBOL() does not (at least not to me). Dunno. > > It's not either/or, they are both wrong ;-) > > The EXPORT_SYMBOL() is not the thing that makes it work. The duplicate > declaration today only works because lib/dump_stack.o is listed as lib-y > in the Makefile instead of obj-y. On blackfin and nds32, this causes the entire > file to just not be included in the final vmlinux, because there are no > references to it. > > With your patch, I would actually expect the lib/dump_stack.o file > to still not be picked up, so now you have a missing EXPORT_SYMBOL() > on the two unusual architectures until the point when you add another > (referenced) symbol to it. Great catch! We should change it from lib-y to obj-y. Of course, the best solution would be if nds32 uses the generic implementation and we could avoid adding __weak. Best Regards, Petr