Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp177047rwl; Thu, 23 Mar 2023 14:28:55 -0700 (PDT) X-Google-Smtp-Source: AKy350YFBq1n6FVXdA46D1dJ7EFlrwge09ACC21GG03boeHACCBe/zDZgj0WYU1hs42fGBQfvI2i X-Received: by 2002:a62:4e88:0:b0:62a:9d6f:98d9 with SMTP id c130-20020a624e88000000b0062a9d6f98d9mr697223pfb.13.1679606935006; Thu, 23 Mar 2023 14:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679606934; cv=none; d=google.com; s=arc-20160816; b=nuPWETPpcZk6DHC72yVSuaB7EQ3Y+mOeWjMwPRUqOEK1ATzShNSiqV+1vgvQdIGLoo kJjM8ZohTv6Vh/mmhf7kqJnKnB77odAkjXVbMfxeaT7xJdv1oJT6w3ccNsGiw3k6tMgY 1ybVIGfOi9LtvJczIyD5cfwk1wLl62JPrkzMxByImgNWeVar5d7F+hgW5qmDQQciiQZ3 +0xzBwZMikswCBEFW1pIVRwkOMAX4kCWCUDXZN59v+SQicBU+kuW/QapmaGXLftprzTd KCnp9aiBt4Vu3QvblAAkqVgWKxWsRDLuUpq5S0aPIgDm/V4QWjLPKXRXpqKH+39Db0If lvUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:dkim-signature; bh=EWwVIz5hLvBmT6Tz5cl4jST1aXNmll6pvQLb1c2drjk=; b=Ve5Op3L845HrmjCbde8GV5lOk/defr4K4JEIx28YksaK6w6xleGLtOz3dq8+oG4yd1 9B6+H4eobEktizLwVron1KsUPnLWLZ4Ac58BbujDxFYwRpShijEtamemINI9XorM/TZI IXkONjZBORFkbCKqZgiP8I4S/xb9EI+4U+yGfmWG140h3G9tfDdIubURc0XIPzzhnsW4 5HYQGIztZ3oJmMGDP4Q3boWsFsn7y/AWMASL0D3MbnxWrv1/H02goACLETDyYBi42KYd PHQEB2Jy3VKqgJXwP1m69Qss93P51fH/QNqAb7UHNjKkkTRjhiSjWGSfFUCh2pa+SKFD EklA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aurel32.net header.s=202004.hall header.b=CLNJ7YLS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 201-20020a6219d2000000b005a8d595767asi8276878pfz.252.2023.03.23.14.28.42; Thu, 23 Mar 2023 14:28:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@aurel32.net header.s=202004.hall header.b=CLNJ7YLS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230196AbjCWVMu (ORCPT + 99 others); Thu, 23 Mar 2023 17:12:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229590AbjCWVMt (ORCPT ); Thu, 23 Mar 2023 17:12:49 -0400 Received: from hall.aurel32.net (hall.aurel32.net [IPv6:2001:bc8:30d7:100::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 460DF2597B; Thu, 23 Mar 2023 14:12:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=aurel32.net ; s=202004.hall; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Content-Transfer-Encoding:From:Reply-To: Subject:Content-ID:Content-Description:X-Debbugs-Cc; bh=EWwVIz5hLvBmT6Tz5cl4jST1aXNmll6pvQLb1c2drjk=; b=CLNJ7YLSLaPjyJTvgUAwcXTSmH 8gwTOo7bDshYvYEvTb92eayZOBGcWwgu/k6cDJauBDofvMB2BjFh6+KJ6NaLs042xBqiuT0pxaLgb v4pjf/Ilr0m0SpPFr7dTqyZFr3FbhelSHsHJ2Zy07THiN40wFBoPvfVUtmNuId33M0NN3d3vSI9wl /KbslUVNgGQRdcf01DO0WxM/Uzo+t02XjB2KNAOPUIxP3qUr+gc3cPm++57DK3bTddS0UUzn4vKj6 S1DK2IAblz+eElWSSC/7KYdAw6rAYUAwr6HGMNhqdynQPDH8T4qE5Zldwa01UZKs/GJlpTxTC2jhZ fyUNs6Tg==; Received: from [2a01:e34:ec5d:a741:8a4c:7c4e:dc4c:1787] (helo=ohm.rr44.fr) by hall.aurel32.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pfSEB-003QpI-Kh; Thu, 23 Mar 2023 22:12:07 +0100 Received: from aurel32 by ohm.rr44.fr with local (Exim 4.96) (envelope-from ) id 1pfSEB-00EeXf-0F; Thu, 23 Mar 2023 22:12:07 +0100 Date: Thu, 23 Mar 2023 22:12:07 +0100 From: Aurelien Jarno To: Ard Biesheuvel Cc: Masahiro Yamada , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Nicolas Schier , linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: remove special treatment for the link order of head.o Message-ID: Mail-Followup-To: Ard Biesheuvel , Masahiro Yamada , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Nicolas Schier , linux-kernel@vger.kernel.org References: <20221012233500.156764-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.7 (2022-08-07) X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2023-03-22 15:51, Ard Biesheuvel wrote: > On Tue, 21 Mar 2023 at 23:26, Aurelien Jarno wrote: > > > > Hi, > > > > On 2022-10-13 08:35, Masahiro Yamada wrote: > > > In the previous discussion (see the Link tag), Ard pointed out that > > > arm/arm64/kernel/head.o does not need any special treatment - the only > > > piece that must appear right at the start of the binary image is the > > > image header which is emitted into .head.text. > > > > > > The linker script does the right thing to do. The build system does > > > not need to manipulate the link order of head.o. > > > > > > Link: https://lore.kernel.org/lkml/CAMj1kXH77Ja8bSsq2Qj8Ck9iSZKw=1F8Uy-uAWGVDm4-CG=EuA@mail.gmail.com/ > > > Suggested-by: Ard Biesheuvel > > > Signed-off-by: Masahiro Yamada > > > --- > > > > > > scripts/head-object-list.txt | 1 - > > > 1 file changed, 1 deletion(-) > > > > > > diff --git a/scripts/head-object-list.txt b/scripts/head-object-list.txt > > > index b16326a92c45..f226e45e3b7b 100644 > > > --- a/scripts/head-object-list.txt > > > +++ b/scripts/head-object-list.txt > > > @@ -15,7 +15,6 @@ arch/alpha/kernel/head.o > > > arch/arc/kernel/head.o > > > arch/arm/kernel/head-nommu.o > > > arch/arm/kernel/head.o > > > -arch/arm64/kernel/head.o > > > arch/csky/kernel/head.o > > > arch/hexagon/kernel/head.o > > > arch/ia64/kernel/head.o > > > > This patch causes a significant increase of the arch/arm64/boot/Image > > size. For instance the generic arm64 Debian kernel went from 31 to 39 MB > > after this patch has been applied to the 6.1 stable tree. > > > > In turn this causes issues with some bootloaders, for instance U-Boot on > > a Raspberry Pi limits the kernel size to 36 MB. > > > > I cannot reproduce this with mainline > > With the patch > > $ size vmlinux > text data bss dec hex filename > 24567309 14752630 621680 39941619 26175f3 vmlinux > > With the patch reverted > > $ size vmlinux > text data bss dec hex filename > 24567309 14752694 621680 39941683 2617633 vmlinux I have tried with the current mainline, this is what I get, using GCC 12.2.0 and binutils 2.40: text data bss dec hex filename 32531655 8192996 621968 41346619 276e63b vmlinux.orig 25170610 8192996 621968 33985574 2069426 vmlinux.revert > It would help to compare the resulting vmlinux ELF images from both > builds to see where the extra space is being allocated At a first glance, it seems the extra space is allocated in the BTF section. I have uploaded the resulting files as well as the config file I used there: https://temp.aurel32.net/linux-arm64-size-head.o.tar.gz -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net