From patchwork Mon Jul 12 06:04:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 472944 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2667199jao; Mon, 12 Jul 2021 00:00:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyW/Lq5f2/iCJ1jNj/lt9KoyFuuGY7BayyZVMbwsGBoBkRg7PfiRhdTqVCPWl9ID74RIILs X-Received: by 2002:a05:6602:2bed:: with SMTP id d13mr11605843ioy.66.1626073248665; Mon, 12 Jul 2021 00:00:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626073248; cv=none; d=google.com; s=arc-20160816; b=W2T+uWf9qePjhtqOk0NPLxlwA1dm6PWBCdSv9KUlM97AIG0Og4Js53N3AXBv89PvBc fVRj5UvO5GBAGNcv2OmDS5GETatG1JQJufrO8dr239Iv7cjAgj8Cwq6z/jYSAJc+xi2v 41TNwWqEEPG1KByiWEK2rSRzVcZ5voPY9fUgrTd21znmBbOBpr4Cj8N52TyjRYB48Zbe RJ/LWQF9iRWpryyAN46Hd4uecwSthL5uYwmdjNkkd6EdNb2/fHbCjVqFUU2/3q8GUMGL FdcpGmjUxJmKWLtCBODLnnsLoUg9HrJPIr24ZC8OF9YeJ/dRoc7HSWEBrZCtfOQKMrfk uATw== 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=YElnv1yuZ9IWCfVY8UxojBqZGJX+HLVgK++CMzw+Nc8=; b=d8eCnSG5xsGfuKiZSelU7E5RIBfNeCZP55bG1F43wwGcQm5dtSy6ZNdxXXtv3vKj/l FSYRJq7xtXoeODqSQ+LFb+MxRX8DtXjDOkbFheLEsDgHT5Syzh1mtQIb6v5FVXeBQCL1 H4P1G0mkVKrNmWzar7yGTSOoKvBIOkWouyQU61mQ5dKeNL99ikYQzXE9uor/ZNCpspSb QhTzCT5kGGR0l+janBpQgN9HW91rdyICiFJQGL3EDUemXHqw0npJAoauBCM9h0YpJ16V 3446uKyAIXIMZMqh9quZWiNylF41b09HXHOfsrRav02vab0YDfldKORe5Y/MvzM/whQn QXuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GX3vr+3M; 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 o11si10328555ilg.108.2021.07.12.00.00.48; Mon, 12 Jul 2021 00:00:48 -0700 (PDT) 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=GX3vr+3M; 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 S240780AbhGLHDd (ORCPT + 12 others); Mon, 12 Jul 2021 03:03:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:38670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238765AbhGLHDD (ORCPT ); Mon, 12 Jul 2021 03:03:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9E85761152; Mon, 12 Jul 2021 07:00:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626073214; bh=jOEpjn/hcpJuviilCQ2NuBdzL8OTNwywGwIyGeUQPOk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GX3vr+3MtxRfNMS004lsAcTtQuddeT0BQWOE/J5WTy2BhFvGyB79J6eTHoiAr2dDW 8EMuOpaGQzN8dWw9DPH7vL/DxmzOdAzqDMZLz2oiFEyvblEaQXnJomIo4WiGcglufS 0yqD70L9pCYWlVrsagxQUMYMQ7L6nDnSnLh4ny6E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Collingbourne , Nathan Chancellor , Nick Desaulniers , Will Deacon , Sasha Levin Subject: [PATCH 5.12 163/700] Makefile: fix GDB warning with CONFIG_RELR Date: Mon, 12 Jul 2021 08:04:06 +0200 Message-Id: <20210712060948.672879435@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060924.797321836@linuxfoundation.org> References: <20210712060924.797321836@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nick Desaulniers [ Upstream commit 27f2a4db76e8d8a8b601fc1c6a7a17f88bd907ab ] GDB produces the following warning when debugging kernels built with CONFIG_RELR: BFD: /android0/linux-next/vmlinux: unknown type [0x13] section `.relr.dyn' when loading a kernel built with CONFIG_RELR into GDB. It can also prevent debugging symbols using such relocations. Peter sugguests: [That flag] means that lld will use dynamic tags and section type numbers in the OS-specific range rather than the generic range. The kernel itself doesn't care about these numbers; it determines the location of the RELR section using symbols defined by a linker script. Link: https://github.com/ClangBuiltLinux/linux/issues/1057 Suggested-by: Peter Collingbourne Reviewed-by: Nathan Chancellor Signed-off-by: Nick Desaulniers Link: https://lore.kernel.org/r/20210522012626.2811297-1-ndesaulniers@google.com Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- Makefile | 2 +- scripts/tools-support-relr.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) -- 2.30.2 diff --git a/Makefile b/Makefile index bf6accb2328c..6682790891df 100644 --- a/Makefile +++ b/Makefile @@ -1006,7 +1006,7 @@ LDFLAGS_vmlinux += $(call ld-option, -X,) endif ifeq ($(CONFIG_RELR),y) -LDFLAGS_vmlinux += --pack-dyn-relocs=relr +LDFLAGS_vmlinux += --pack-dyn-relocs=relr --use-android-relr-tags endif # We never want expected sections to be placed heuristically by the diff --git a/scripts/tools-support-relr.sh b/scripts/tools-support-relr.sh index 45e8aa360b45..cb55878bd5b8 100755 --- a/scripts/tools-support-relr.sh +++ b/scripts/tools-support-relr.sh @@ -7,7 +7,8 @@ trap "rm -f $tmp_file.o $tmp_file $tmp_file.bin" EXIT cat << "END" | $CC -c -x c - -o $tmp_file.o >/dev/null 2>&1 void *p = &p; END -$LD $tmp_file.o -shared -Bsymbolic --pack-dyn-relocs=relr -o $tmp_file +$LD $tmp_file.o -shared -Bsymbolic --pack-dyn-relocs=relr \ + --use-android-relr-tags -o $tmp_file # Despite printing an error message, GNU nm still exits with exit code 0 if it # sees a relr section. So we need to check that nothing is printed to stderr.