From patchwork Mon Jul 20 01:01:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 6824761 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 72600C05AC for ; Mon, 20 Jul 2015 01:04:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 66A1C20643 for ; Mon, 20 Jul 2015 01:03:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0753920623 for ; Mon, 20 Jul 2015 01:03:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753920AbbGTBD4 (ORCPT ); Sun, 19 Jul 2015 21:03:56 -0400 Received: from one.firstfloor.org ([193.170.194.197]:50407 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753662AbbGTBDz (ORCPT ); Sun, 19 Jul 2015 21:03:55 -0400 Received: from basil.firstfloor.org (97-120-69-240.ptld.qwest.net [97.120.69.240]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by one.firstfloor.org (Postfix) with ESMTPSA id 91C3686A6F; Mon, 20 Jul 2015 03:03:52 +0200 (CEST) Received: by basil.firstfloor.org (Postfix, from userid 1000) id E15D4A074D; Sun, 19 Jul 2015 18:01:22 -0700 (PDT) From: Andi Kleen To: linux-kbuild@vger.kernel.org Cc: mmarek@suse.cz, linux-kernel@vger.kernel.org, Andi Kleen Subject: [PATCH] kbuild: Fix .text.unlikely placement Date: Sun, 19 Jul 2015 18:01:19 -0700 Message-Id: <1437354079-18609-1-git-send-email-andi@firstfloor.org> X-Mailer: git-send-email 2.4.5 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andi Kleen When building a kernel with .text.unlikely text the unlikely text for each translation unit was put next to the main .text code in the final vmlinux. The problem is that the linker doesn't allow more specific submatches of a section name in a different linker script statement after the main match. So we need to move them all into one line. With that change .text.unlikely is at the end of everything again. I also moved .text.hot into the same statement though, even though that's not strictly needed. Signed-off-by: Andi Kleen --- include/asm-generic/vmlinux.lds.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 8bd374d..1781e54 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -412,12 +412,10 @@ * during second ld run in second ld pass when generating System.map */ #define TEXT_TEXT \ ALIGN_FUNCTION(); \ - *(.text.hot) \ - *(.text .text.fixup) \ + *(.text.hot .text .text.fixup .text.unlikely) \ *(.ref.text) \ MEM_KEEP(init.text) \ MEM_KEEP(exit.text) \ - *(.text.unlikely) /* sched.text is aling to function alignment to secure we have same