Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1535804pxb; Mon, 22 Feb 2021 04:44:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwK3xoYMw3imU9JhS3NwfE0b2EdUiSr7HKXvHHnoBrWuzqSwyL8VdC5cU5me/7pPQYxpuLK X-Received: by 2002:a17:906:3e42:: with SMTP id t2mr18287572eji.554.1613997884208; Mon, 22 Feb 2021 04:44:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613997884; cv=none; d=google.com; s=arc-20160816; b=v8ORV0Ewj0mPCrW5+yhJulx18IIQFQ1Pasb2ffNuIbIe2ah64Ws5p5eAWDjr4T8ty1 dN18HgH1k1T2mT79Hcm+cDjDEaG9yR8WlgaH17Ows3uDjrQNzpFE4eI795YQu/TnnLo3 cDaL93sIGDCeq3IjV17uehVmpG54V47Uxf2/yM9t8CGKE2GuvFUoQ3g48mL7XySmgrId gyTWo5NQs+hD65f/iJrJRlWAy/6KIXOWHGZvBDg68BmTptg8c+XKgMg7HtBzGNGLAI9K blOcP/PXzBmjw8GlJB7Pu4/D7UOHZgTSU2ci83cMD8/3UJpRxaGoOLgOP80HMknkbSe8 pfJA== 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=Dkk3nt5BEsTf8xEzAYmV0EGLghGA62MkliA6o0nBtfo=; b=eyv/WQNgLvp9qVED9KX8ATFk6dlAzh2cGABXIDCUttmdTzI2Cq7mKgBa+62heB3IPP 6KWYDZ9AqCu/8M45Xjb0DcLOcvtL7+BoX60EeDMyLio+raj0TvyNAHQXwxUSeMcritWt x8n2Bnl6FnPM7lTp61+FNZ6qreUHnAObKDyfxfGRd26ySfnlv7QYdYI23CYVbIJ9Yq2L qlgryL0fX0/HBf6d9CVCitvJlp+zyIgyE6qUiWdfC+uca2g9LZP9bnPcLcaBd2cbUGCm Rr8xPcenamREAhkcGhGPBLzBSA2NzLHRH+K+QTEVCYvesMJa83JRQwdljsLPusN9oFKr wHrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sSvn2U2Z; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n5si5928264ejs.445.2021.02.22.04.44.21; Mon, 22 Feb 2021 04:44:44 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=sSvn2U2Z; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231580AbhBVMnX (ORCPT + 99 others); Mon, 22 Feb 2021 07:43:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:45468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230479AbhBVMRC (ORCPT ); Mon, 22 Feb 2021 07:17:02 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 17EC064F12; Mon, 22 Feb 2021 12:16:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613996194; bh=PYrS36eLoHwCchuEv3GtasPtYiowxhUsjoGUmCqlgto=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sSvn2U2ZbO5wLsR8sYWnwRPr5pIXnlPPyNRgGVv+CYOOgPccXzX4MDq5B5/+6xBZM Epj8cdSStqUiP28exxu69KqV+T5aEN4X5Kc6zvDBhnasvQyD6mTnSpCYYAKNuogqar vFVEhFW+SIZSIGPCe+lw7lhtxzZWVp6xftyVe6fA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fangrui Song , kernel test robot , Arnd Bergmann , Nick Desaulniers , Douglas Anderson , Nathan Chancellor , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 4.19 24/50] firmware_loader: align .builtin_fw to 8 Date: Mon, 22 Feb 2021 13:13:15 +0100 Message-Id: <20210222121024.622972918@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210222121019.925481519@linuxfoundation.org> References: <20210222121019.925481519@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fangrui Song [ Upstream commit 793f49a87aae24e5bcf92ad98d764153fc936570 ] arm64 references the start address of .builtin_fw (__start_builtin_fw) with a pair of R_AARCH64_ADR_PREL_PG_HI21/R_AARCH64_LDST64_ABS_LO12_NC relocations. The compiler is allowed to emit the R_AARCH64_LDST64_ABS_LO12_NC relocation because struct builtin_fw in include/linux/firmware.h is 8-byte aligned. The R_AARCH64_LDST64_ABS_LO12_NC relocation requires the address to be a multiple of 8, which may not be the case if .builtin_fw is empty. Unconditionally align .builtin_fw to fix the linker error. 32-bit architectures could use ALIGN(4) but that would add unnecessary complexity, so just use ALIGN(8). Link: https://lkml.kernel.org/r/20201208054646.2913063-1-maskray@google.com Link: https://github.com/ClangBuiltLinux/linux/issues/1204 Fixes: 5658c76 ("firmware: allow firmware files to be built into kernel image") Signed-off-by: Fangrui Song Reported-by: kernel test robot Acked-by: Arnd Bergmann Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers Tested-by: Douglas Anderson Acked-by: Nathan Chancellor Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- include/asm-generic/vmlinux.lds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index f65a924a75abd..e71c97c3c25ef 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -363,7 +363,7 @@ } \ \ /* Built-in firmware blobs */ \ - .builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) { \ + .builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) ALIGN(8) { \ __start_builtin_fw = .; \ KEEP(*(.builtin_fw)) \ __end_builtin_fw = .; \ -- 2.27.0