From patchwork Wed Jun 17 21:06:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 190904 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp799367ilo; Wed, 17 Jun 2020 14:06:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwf+x+6nqPBAhuCXBNb6O+lXHCqpmzjgTT6blwRC3GrCgTaxcoZmeHfMH/bg+GCtoGJNd9f X-Received: by 2002:aa7:c682:: with SMTP id n2mr1037542edq.18.1592427985730; Wed, 17 Jun 2020 14:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592427985; cv=none; d=google.com; s=arc-20160816; b=E2kRRLJsF4tHqcO9FF8tXpZotQf08MzOdIt3wV3Y7wYx5qGS1mD+x4XRvXuubvMYZJ vOGg30o9WEL/Utx8W2Ne3qJvlnZngKr39Ufrf9jms8RN0oQxTQhY9sKwRuvHW0/elGXz LUiHIunFDmXXtSmnVkxB+njSASLRsAL36csfX9VDp7niZ46iTZLI1RDEQdXjOvVCIGPj uGqUkhDdT5TxHjr27AtU9aai4h45s9weCqv2ABRLo4+FlTVH6bDAzSRy87+9O5L08/kG Vz4Meed9clI0FG8K/5J5ZAQWt3yzCQlxhZ00M35bOKrmgBPk7w+1e9KTGmiz8TvJvak/ egcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:from :subject:mime-version:message-id:date:dkim-signature; bh=d0+Tzz9YePJeli6i74FfEPDYMLFJV/dTb97VxgPARRM=; b=EwAe7hCGoCvOge5dZwg8hRDHMhtD4lDj93gl4Li+YNGX4Zg/w0O9VjWmerKE/i/UGY bLMC7cgq1OkrEKqlMJT2BID5Mdg7hxSHZnayXek+RXtxzWGXFqvW0EE9QbtxA2rky22c rITU4dy15ldSXiVKKKTKedi2RiL91oU4zhbbG0n/soXo1z2CQe0bJwlbR4EwNbSF1Kbv 93Dai57wsxIn3a+x0O6xMv4RKaqGVMgDOkWtDHB1J+FM+hyOrD03AL8HTyETfkO5Ez5h hsw+dNZRU47Nxix9UMeNfocBWLvZm2R1bCtETiA4hmri4sZkrllOToVVIozou8Wo6g2k OfYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="s65S27c/"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by8si636544edb.354.2020.06.17.14.06.25; Wed, 17 Jun 2020 14:06:25 -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=@google.com header.s=20161025 header.b="s65S27c/"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726955AbgFQVGY (ORCPT + 15 others); Wed, 17 Jun 2020 17:06:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726953AbgFQVGY (ORCPT ); Wed, 17 Jun 2020 17:06:24 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A6D5C06174E for ; Wed, 17 Jun 2020 14:06:24 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 186so3964632yby.19 for ; Wed, 17 Jun 2020 14:06:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=d0+Tzz9YePJeli6i74FfEPDYMLFJV/dTb97VxgPARRM=; b=s65S27c/KhuLOWAdWfLs8FLqZHfP5cSau7W+PswhE2Jr9spEw3hA0lbGxcJUfsJDgL mAg1ZrtF5oypvB0HM5sogq1N0s+ug/nOQ7/yvOxlCJKtbxguewHBg5KloSP4CbqEmOo/ CCfvgxIrTsbIgLi7app8Hb6phNzgxKWbo4yQaEraDSljNMKaz1NJi3vx1Inw0SLHgTkj Ydvhkhn5cNvUjUH0z+DbN8O+kgn6bq/RF3WHmr0EpT4CuGQ0tZEY8j6N5T+4VDqMnsQ/ qIPbR2yOvnBShQupKjFVRYYp3QPIG7dYj6mR2rfqMkjJqxnBtGoebDFB75f69nfKfNnR NHPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=d0+Tzz9YePJeli6i74FfEPDYMLFJV/dTb97VxgPARRM=; b=suoCWPTCdAy/gxVAI2ldr8xmlCElKevB8YCzzHDe85HR5Ky8qqYHPODEhn4GAJA0t7 Gqugu24c1BbrsFvVNs5MzN1uTvIPOADDj3kz7u6vNwGIYew8AzhFo9HQhuIMEYLNT6B5 7cyiEMt4QUEPbCcKZTa7vOAYECW70/2ldCseurVWccauTynntCjOo5jfI0EuAMmQhR3x pjtdUZJG2fmPbmQLJm3K8ooJ9vZmGqzDk1D+RF8+wUOFfRU9v76ns5QbZnUISLMzCcmP 0zMflT04reNK4yP1QnBC+IAydL74axHtKAKfUDOnz61ssjaBIsqrdc6D0JTaahrtGe0S 8rtg== X-Gm-Message-State: AOAM533e0jsNtEY0Rj+RwTrZ/Nri8SvIVCIqwwCwzXL4FwqDAzTaUNxi h2HyhJHWX1jc5u4pq1nH7oH0nYOrtKrNx8ZLais= X-Received: by 2002:a25:7086:: with SMTP id l128mr1423806ybc.34.1592427983669; Wed, 17 Jun 2020 14:06:23 -0700 (PDT) Date: Wed, 17 Jun 2020 14:06:13 -0700 Message-Id: <20200617210613.95432-1-ndesaulniers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.27.0.290.gba653c62da-goog Subject: [PATCH] vmlinux.lds: consider .text.{hot|unlikely}.* part of .text too From: Nick Desaulniers To: Arnd Bergmann Cc: clang-built-linux@googlegroups.com, Kees Cook , Nick Desaulniers , stable@vger.kernel.org, Jian Cai , Luis Lozano , "=?UTF-8?q?F=C4=81ng-ru=C3=AC=20S=C3=B2ng?=" , Manoj Gupta , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org ld.bfd's internal linker script considers .text.hot AND .text.hot.* to be part of .text, as well as .text.unlikely and .text.unlikely.*. ld.lld will produce .text.hot.*/.text.unlikely.* sections. Make sure to group these together. Otherwise these orphan sections may be placed outside of the the _stext/_etext boundaries. Cc: stable@vger.kernel.org Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=add44f8d5c5c05e08b11e033127a744d61c26aee Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=1de778ed23ce7492c523d5850c6c6dbb34152655 Link: https://reviews.llvm.org/D79600 Reported-by: Jian Cai Debugged-by: Luis Lozano Suggested-by: Fāng-ruì Sòng Tested-by: Luis Lozano Tested-by: Manoj Gupta Signed-off-by: Nick Desaulniers --- include/asm-generic/vmlinux.lds.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.27.0.290.gba653c62da-goog diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index d7c7c7f36c4a..fe5aaef169e3 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -560,7 +560,9 @@ */ #define TEXT_TEXT \ ALIGN_FUNCTION(); \ - *(.text.hot TEXT_MAIN .text.fixup .text.unlikely) \ + *(.text.hot .text.hot.*) \ + *(TEXT_MAIN .text.fixup) \ + *(.text.unlikely .text.unlikely.*) \ NOINSTR_TEXT \ *(.text..refcount) \ *(.ref.text) \