From patchwork Mon Feb 8 15:00:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 378559 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4756818jah; Mon, 8 Feb 2021 07:04:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8F7691+o0zs0ZfKLc528oWQUHfjKh8HnX5COMGcl1XZEJ/X7BRMtwRPst83kBeLVokNYZ X-Received: by 2002:a05:6402:430c:: with SMTP id m12mr18098975edc.299.1612796678981; Mon, 08 Feb 2021 07:04:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612796678; cv=none; d=google.com; s=arc-20160816; b=Bqdm9ifeUnUrNVmOESljaxsqOZNBwB0YzGnlH/3jWrzwkVZMDd+OyWBY/AYAgF4bzJ uSi6kFMvvTMg3wjI7Im+2wrPhHj/PkzAcNsz070P94mPCzUQVVFYeVJBkDcMO+DuE5TV /WwhEqUtz6ESip9I0YWy2fOb0CdAFe7yF7sh85OcoOHqCaVFcPrwQ4okXs0iEwFtCueD OaCu/R0tunouUU8Let0LpJQD+gI1XbAuwkKKLknmd1lBwZ/q6C7Xmr9OioQDzu1uBv2E 8GiHnY5NbeLUVVGiF0HLUPHEmwjllgWTrGHIvJnpd7VgioqzJLt8cb/z5VS6v8i/XVeo EKOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mbUWFrQF3wEb8RZbm3pEkul251nLk96m6ifxfG3c0ZU=; b=W2WV53I+EdURLvDk5sF2kqR7X1rCv9UyPMlooac8mcw9b8uqDrIYHZOj2Nycy1hA8b p2gGaEW7qLFdZoFXR0nsLz8tkE6//bVLj7jjYkPCZLD6Dz1Uw+O1im8rNc0cWCk6Gq1H 4IqaDcJr9CveiXXdiMoc1DEloLcBXaIXuI9R1Jx/hwWxuMObEvb+1bg4/gDN8mKXfv3X 6JdjrgEQHE26Zi+0mpvQD+jAf/JkiF7WFglGtxzPYufEZ/Pt8NPYoKRjHiDPgQKJDDDV pfMbSgkWEmaHjDJLRVEeGQIpLkWRatqBANNocrp1gTVKI3nXxKJuTa9yHxW8PuZiyLvJ TVbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eI27AJY9; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d13si9891535edy.472.2021.02.08.07.04.38; Mon, 08 Feb 2021 07:04:38 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eI27AJY9; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232437AbhBHPDZ (ORCPT + 13 others); Mon, 8 Feb 2021 10:03:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:51778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232380AbhBHPDU (ORCPT ); Mon, 8 Feb 2021 10:03:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id F2FA964EB7; Mon, 8 Feb 2021 15:02:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612796555; bh=KVhmUdS4Zyo2qiysiPo3/3eJXXQ/2cbzLr1owaatF9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eI27AJY95Ic+vg+6+7M2cvyvJ4f8tuS9C7mMALUaaDxuDqTQjCOEPnmH4s6xQzhG3 lcgBY5KYxoN4DReOmJRxu6c/twP9qMf/vT9CXPKr8Nz3ZOnoJEesQXZKTZmzsW2rjp lfplzd3SRJBbDMGwxkcDNSZHnWbzPEyaYDHSdp28= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Barret Rhoden , Andrew Morton , Linus Torvalds Subject: [PATCH 4.4 22/38] elfcore: fix building with clang Date: Mon, 8 Feb 2021 16:00:44 +0100 Message-Id: <20210208145806.154119176@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210208145805.279815326@linuxfoundation.org> References: <20210208145805.279815326@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann commit 6e7b64b9dd6d96537d816ea07ec26b7dedd397b9 upstream. kernel/elfcore.c only contains weak symbols, which triggers a bug with clang in combination with recordmcount: Cannot find symbol for section 2: .text. kernel/elfcore.o: failed Move the empty stubs into linux/elfcore.h as inline functions. As only two architectures use these, just use the architecture specific Kconfig symbols to key off the declaration. Link: https://lkml.kernel.org/r/20201204165742.3815221-2-arnd@kernel.org Signed-off-by: Arnd Bergmann Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Barret Rhoden Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- include/linux/elfcore.h | 22 ++++++++++++++++++++++ kernel/Makefile | 1 - kernel/elfcore.c | 25 ------------------------- 3 files changed, 22 insertions(+), 26 deletions(-) delete mode 100644 kernel/elfcore.c --- a/include/linux/elfcore.h +++ b/include/linux/elfcore.h @@ -55,6 +55,7 @@ static inline int elf_core_copy_task_xfp } #endif +#if defined(CONFIG_UM) || defined(CONFIG_IA64) /* * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out * extra segments containing the gate DSO contents. Dumping its @@ -69,5 +70,26 @@ elf_core_write_extra_phdrs(struct coredu extern int elf_core_write_extra_data(struct coredump_params *cprm); extern size_t elf_core_extra_data_size(void); +#else +static inline Elf_Half elf_core_extra_phdrs(void) +{ + return 0; +} + +static inline int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset) +{ + return 1; +} + +static inline int elf_core_write_extra_data(struct coredump_params *cprm) +{ + return 1; +} + +static inline size_t elf_core_extra_data_size(void) +{ + return 0; +} +#endif #endif /* _LINUX_ELFCORE_H */ --- a/kernel/Makefile +++ b/kernel/Makefile @@ -77,7 +77,6 @@ obj-$(CONFIG_TASK_DELAY_ACCT) += delayac obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o obj-$(CONFIG_TRACEPOINTS) += tracepoint.o obj-$(CONFIG_LATENCYTOP) += latencytop.o -obj-$(CONFIG_ELFCORE) += elfcore.o obj-$(CONFIG_FUNCTION_TRACER) += trace/ obj-$(CONFIG_TRACING) += trace/ obj-$(CONFIG_TRACE_CLOCK) += trace/ --- a/kernel/elfcore.c +++ /dev/null @@ -1,25 +0,0 @@ -#include -#include -#include -#include -#include - -Elf_Half __weak elf_core_extra_phdrs(void) -{ - return 0; -} - -int __weak elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset) -{ - return 1; -} - -int __weak elf_core_write_extra_data(struct coredump_params *cprm) -{ - return 1; -} - -size_t __weak elf_core_extra_data_size(void) -{ - return 0; -}