Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3396782pxb; Tue, 19 Apr 2022 01:17:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgLSeWtqR4YQrxpRIWqhsG73UUDUPDj1PLBzpZxABPEZALd8ZbyhEz0uzRPxo+R9wDCYAE X-Received: by 2002:a17:902:bcc5:b0:158:f19e:ab10 with SMTP id o5-20020a170902bcc500b00158f19eab10mr12011512pls.130.1650356233264; Tue, 19 Apr 2022 01:17:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650356233; cv=none; d=google.com; s=arc-20160816; b=hAAoIok78sXp+iiIIPezl1Fp4Ba3FVvQ4Re/A912BIrmACRvEiEIHeD/y62ab7+Okl hOimAb9Em/30dDVB3sycO1guovUvncaLbUT05pOCRgy07kQg6XhHXMLgpU2k8jJci1E9 cxZWtNwQb6Yw9WQROMpZ9qJpz20J0lSNMic/9/fxl/IIo5MvHHtst3VCv4zA7O7FD5lW 78NmyVdTFLEHj8I7bREz+zYmXe8G84aJmYafBIrm3JrkkLCpmvg/ob055oLIr929Imgh YTrjbGoe+3AKMn4BoNX/dXijbnZYJYScblmpB6+uLUWAVaA806F0yyNK9AhAZtQqoNC2 i6bg== 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=2gexqenITnGVle84H2THouXYn91iLHK8Fy1DVzhCxPk=; b=IwPqkRhdfsIznoU2FuAY1eWt6edCW9Jdm/8w1s0soBnSdB4/Jx3ny+hBXAcm0KCqI7 ycKFpHR821NAhBbC741Rt9qbaiJ/sLumQrgOEcH1yOK+6DiIyA/j5KbCzcMWQ7QVlEwR XrVijB0kzR7Ligkdo7SnMWINz7pe4RgxYW1b3IuOT5fQvkOmPUbhdfug7hKuqkbBYBKP 0HtK2xEn28R04iXR9gwy0e9PbbQ7oLZSaSzo2lfThmmEluLe454TEIU661PqZQQS4qsp Bz5N83bEHN/vwk4M84l8QboEwNdLf/EUAxjLTgCOmzpQPvEFZVjbTFFzKgRZu3CaNFDw EUPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=egbDFbHj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oj8-20020a17090b4d8800b001d28b845edcsi1506750pjb.59.2022.04.19.01.16.59; Tue, 19 Apr 2022 01:17:13 -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=@linuxfoundation.org header.s=korg header.b=egbDFbHj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344462AbiDRO12 (ORCPT + 99 others); Mon, 18 Apr 2022 10:27:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343991AbiDROQm (ORCPT ); Mon, 18 Apr 2022 10:16:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F9DD396B6; Mon, 18 Apr 2022 06:13:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B4C05B80EE7; Mon, 18 Apr 2022 13:12:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF605C385A1; Mon, 18 Apr 2022 13:12:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650287564; bh=nf6MZubfscScPYM1mAKwbtIrJkP1KUcEaRW2x1T03Qc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=egbDFbHjGMYA2B0JoOuHJDyZxhxWG+t5lDo97YS82LXxTUJAADlMpEXBRmsit5I0y TUqIP3vDS5L0CT7pGtgQ5Lw0R1+QoOfzJvt+ao8KHqD/2M7m893kQlgUee+mfCa/59 0xkdBSpLHOmKHBAB3K67sFHgwGlbVjJIUzyRmAwg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Fangrui Song , Ard Biesheuvel , Will Deacon Subject: [PATCH 4.9 200/218] arm64: module: remove (NOLOAD) from linker script Date: Mon, 18 Apr 2022 14:14:26 +0200 Message-Id: <20220418121207.433818636@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121158.636999985@linuxfoundation.org> References: <20220418121158.636999985@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Fangrui Song commit 4013e26670c590944abdab56c4fa797527b74325 upstream. On ELF, (NOLOAD) sets the section type to SHT_NOBITS[1]. It is conceptually inappropriate for .plt and .text.* sections which are always SHT_PROGBITS. In GNU ld, if PLT entries are needed, .plt will be SHT_PROGBITS anyway and (NOLOAD) will be essentially ignored. In ld.lld, since https://reviews.llvm.org/D118840 ("[ELF] Support (TYPE=) to customize the output section type"), ld.lld will report a `section type mismatch` error. Just remove (NOLOAD) to fix the error. [1] https://lld.llvm.org/ELF/linker_script.html As of today, "The section should be marked as not loadable" on https://sourceware.org/binutils/docs/ld/Output-Section-Type.html is outdated for ELF. Tested-by: Nathan Chancellor Reported-by: Nathan Chancellor Signed-off-by: Fangrui Song Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220218081209.354383-1-maskray@google.com Signed-off-by: Will Deacon [nathan: Fix conflicts due to lack of 596b0474d3d9, be0f272bfc83, and 24af6c4e4e0f] Signed-off-by: Nathan Chancellor Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/module.lds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arm64/kernel/module.lds +++ b/arch/arm64/kernel/module.lds @@ -1,3 +1,3 @@ SECTIONS { - .plt (NOLOAD) : { BYTE(0) } + .plt : { BYTE(0) } }