Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp789676ybt; Wed, 17 Jun 2020 14:10:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcfvfF3XOSLVwVztdQuYDGhz7+ciSZLIWwCmYn7uiGdqgyhNFTzrjfCcV6b8pxlHzjmT8N X-Received: by 2002:a17:906:f1d5:: with SMTP id gx21mr1060059ejb.416.1592428238074; Wed, 17 Jun 2020 14:10:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592428238; cv=none; d=google.com; s=arc-20160816; b=zlcGOQGB5xAKq+NPIjGEmLUKsmAhXYPNb9XPJtHk1/F9ud25rJIDuUYeGqAYJYJgmg aUS4z2+xVa4ufCR0tiF+567ahEKqXj+ACNWZ736VEjqKdHzryCkOvBRaEKF5WU+L6u6I w9dMozSmjLggVAPA9za2kov9/2P5p1O9Wr17Y0z7k73BkpFSTC6K4OZoN7Z3wkdPQ/KV wmdP05bE4HlKJHHu5b8nbC+Gv2MForVWN2I4xfjYm0WIUQ8xWpFC/Scxvdxo30R8PG16 9/i/Ks8AAT7FAZtGYEAOhEFJ6OH8FbbXJRrVmucSMatNg0TTP3XezHRKTZfGJRXFLILL 4o2Q== 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=Lux4Uq4X+9MIYHl8JAWAlEXrJjPzdA1sWYaXWZSQa43fAwa6cvVWYliMQHz2pQkW8f 1sek07PRK/P7P0+p4l2cXrDsX2NtQL+7kPqs7VPF0FprT6zbG/GoF0vD3CEfZEe6QItd zTkzxJKM1JMnQ80r9pRDyJ7ZsONXEajznew8pBluyY1vreUgy5H3tuCt5PxLLo1v3RiE xxXus7iKG7aCIwHNNTizWCyXhvu8faMkNbMoG6hQPpo61Rgq7ilfmrUDuSv6s2eySx1n dGsVUlCkgmlup/1Cbvoob5T2zO+tCLq7AOu/ZmcwQhixLBn+eOS/e/9CRkog0VsAFcsD VbTg== 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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 g8si611930ejo.221.2020.06.17.14.10.13; Wed, 17 Jun 2020 14:10:38 -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; dkim=pass header.i=@google.com header.s=20161025 header.b="s65S27c/"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726965AbgFQVGZ (ORCPT + 99 others); Wed, 17 Jun 2020 17:06:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726761AbgFQVGY (ORCPT ); Wed, 17 Jun 2020 17:06:24 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B265C0613ED for ; Wed, 17 Jun 2020 14:06:24 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id s7so4042416ybg.10 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=Mfnq/+Iicl4FFt71DqM2JVzHJSbnO8zBTakXqU2impG2bpINSlV4cxcaBP0/WBjDY0 fuAP/Z3SXB61PNQOq+ckBesWIIy/NlSIqW3/+HD12b+0zL0ehVjjKRvvF+7SvwUy+Wjo hrQRlxAoLy3XBfvbvXYqVw4yvlloBgMsYWEiMUA0jx2GSHzvutEbsqnNn5vSWDtznPJf Rrg794bRx5G+MvsjT7yJ0WSd0hHDoFcws0CupagHJKL0aLI5UgSatmSJDrxvmjBeX88T uG9HECy1rNQQvyt6nNqk2vWte2R+bWr5l+HZHdyM595Xa12eN9wHROoz+PQ7g+ZI1Szn GNnQ== X-Gm-Message-State: AOAM532UT+MeYY2XcW0wIXQbPRCWUpW7r3bEs573YRwEEph/4Cggcn7O NcgDqXPrUHokoH9H9x9kTjZPclfz7LJVdsJiCHI= 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=3Dbinutils-gdb.git;a=3Dcommitdiff;h=3Da= dd44f8d5c5c05e08b11e033127a744d61c26aee Link: https://sourceware.org/git/?p=3Dbinutils-gdb.git;a=3Dcommitdiff;h=3D1= de778ed23ce7492c523d5850c6c6dbb34152655 Link: https://reviews.llvm.org/D79600 Reported-by: Jian Cai Debugged-by: Luis Lozano Suggested-by: F=C4=81ng-ru=C3=AC S=C3=B2ng 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(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.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) \ --=20 2.27.0.290.gba653c62da-goog