Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp483293pxf; Thu, 8 Apr 2021 07:08:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw51C7f4iRjB4FuWAnNki54HuMN9x37J5nnpv2EPc77Of/iRPCFAcyfpaLPaADOI0LY8UXK X-Received: by 2002:a17:902:bc4c:b029:e9:175e:3367 with SMTP id t12-20020a170902bc4cb02900e9175e3367mr8034991plz.7.1617890889154; Thu, 08 Apr 2021 07:08:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617890889; cv=none; d=google.com; s=arc-20160816; b=gOd/zj//ZqBlQGHY+xo4v7r8kPra+x2EWIiq/t40VV+tUiMerwp50jv02BVpT6BGBX PvwrDBI5B+kbdJcBeu1yQchNHLWu9vi40qqCW0/P6TA/hWXNdKfGTYjjncMhPwO3hc8L fjn7FlikJeY2MGrGEwB1RAwhnD9Gn+JaIlROIrvjYhnXycMKaIV6JeWQFkZ/hISRs0zR 14z2D7iITgmOxfhrOL/J9cV73VmBGpy9gErqsTLqDW8bo35Ka26dboKDOGsZ22JOqGTE YNnkUgCDqPSQHJuMH/n4hKvXOhM/QY/UBBKgj4w5gG68xCWsIwy1vMfaGGeka5z9VyVE IdKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=pVS9FN+Th+Q5n4b8hTscNVGIyGRooQ8uBfR9MOI4Gr8=; b=Ux+AW70j6oB6rg4Qb5SRikMEil4NpPCJZIykYYV1zdNU+nfDEXUdlY96d9IwIoAm/j 8Rn1MS+NNkdM9xDeFEPyzm1k/iGl6q458o3FF4KVkeqjkx96zKH9mX0/rw0PzCx+NiGi mVna3zeBcSITQ7kLq52uaodhaS3r/2K5sB49iFdDuOh3gSbuIo5e+U4vReygtpmMCqCu XuwKW/bhAExaAQdm5+VfPYNc4kc09FT23opL0sSwsEo4b7+L8P4UHmHbLX7G2NUXT19R 7ejFgQHGuzBt0qULD6fVOsGbC69Ez9UzIuDDORFiNcy/LxU57rivUoBS9hrIKsr45a07 qe2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 7si27474747pfu.133.2021.04.08.07.07.56; Thu, 08 Apr 2021 07:08:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231952AbhDHOGb (ORCPT + 99 others); Thu, 8 Apr 2021 10:06:31 -0400 Received: from mga01.intel.com ([192.55.52.88]:8221 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231924AbhDHOGY (ORCPT ); Thu, 8 Apr 2021 10:06:24 -0400 IronPort-SDR: SXQtDkgFO+sXdaVUPY/qAVdJrBWfCnqgPACWBi8N5b53tQyLWV8xSIK6PujQmEmhRnL4AyWgPh gpvjeYwhi9EA== X-IronPort-AV: E=McAfee;i="6000,8403,9948"; a="213955020" X-IronPort-AV: E=Sophos;i="5.82,206,1613462400"; d="scan'208";a="213955020" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2021 07:06:01 -0700 IronPort-SDR: YeonUy7lZZP2WoUSifB3wyzd2TbbIJyqUpW6r0FdBjI6XXcJcyFhvggZKfJzlZGVeJIJTlNkmH EuAlnpTc9eGA== X-IronPort-AV: E=Sophos;i="5.82,206,1613462400"; d="scan'208";a="448675712" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2021 07:05:58 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lUVIA-002Iyg-UR; Thu, 08 Apr 2021 17:05:54 +0300 Date: Thu, 8 Apr 2021 17:05:54 +0300 From: Andy Shevchenko To: Jessica Yu Cc: Stephen Boyd , Andrew Morton , linux-kernel@vger.kernel.org, Jiri Olsa , Alexei Starovoitov , Evan Green , Hsin-Yi Wang , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Rasmus Villemoes , linux-doc@vger.kernel.org, Matthew Wilcox Subject: Re: [PATCH v3 04/12] module: Add printk format to add module build ID to stacktraces Message-ID: References: <20210331030520.3816265-1-swboyd@chromium.org> <20210331030520.3816265-5-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 08, 2021 at 03:44:57PM +0200, Jessica Yu wrote: > +++ Stephen Boyd [30/03/21 20:05 -0700]: ... > > +static void init_build_id(struct module *mod, const struct load_info *info) > > +{ > > + const Elf_Shdr *sechdr; > > + unsigned int i; > > + > > + for (i = 0; i < info->hdr->e_shnum; i++) { > > + sechdr = &info->sechdrs[i]; > > + if (!sect_empty(sechdr) && sechdr->sh_type == SHT_NOTE && > > + !build_id_parse_buf((void *)sechdr->sh_addr, mod->build_id, > > + sechdr->sh_size)) > > + break; > > + } > > +} > > Why not just look for the .note.gnu.build-id section instead of trying > to parse each note section? Doesn't it always contain the build id? At > least the ld man page seems to suggest this section name should be > consistent. Interesting idea (in positive way!), I'm wondering what Clang does in such case. -- With Best Regards, Andy Shevchenko