Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5035120pxb; Mon, 15 Feb 2021 07:54:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHRktwggzJw4feWrMJdumpsUwlaj5G9pmPqLAud73sAj2891Gw3sy0kv6Kea3AqvlowSYX X-Received: by 2002:a05:6402:13cd:: with SMTP id a13mr16463446edx.87.1613404454159; Mon, 15 Feb 2021 07:54:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613404454; cv=none; d=google.com; s=arc-20160816; b=TOK60NV6uFQpx2LuZSATGro6ZaU1oz1oEgVicUbgQl5An1y+wYCz0efkoKFiRaUTaH ZI3CaO75Oaid2garkf6f0/PjTJQ7skdUpDyR3N0tvbfzC21ESMA74DyNDhwrDdAtUQpN iWgDaetlrskIyyzYHyzMBLHHjER6PPDAUPA/gqyx/ct4W7bcZc+bp2C7kzZHt5Fxl/IC IHo6NKqSXlYblqufd1AAkRE6o5jSA6sLoeH53llh4ppmGIRXfz/L59gQ7+B81xNhMnZl 4OgF1lqbqciVlNqKXAJQr4UqELksXJeH7EDZYPZ/nTwC2pD1tOmPBG/LGzfNn3XJAawf 5UUA== 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=PNF6FnYeEXpLtL7Zvf6IVHZQnQyHnK+DBxINiML+9ns=; b=wt53DoLbT7nihzpvo3/DdhH7Ld7MiMHWlIEqmyLz8FICfHqVNDwMVnXBM23XigV4R/ furwMIrgckFQ2+u/Wq9iVsPqMf58nrXYOhFYtkFdVUHni8tNUIKG/InGIqnkKAY9jgsB GkvRTRSb3KFdQ/f/Nc6ccPq26W5kkR2FDex9+Tu1wxb7d9ltuFciQafOgSPldHuCHvJ+ 2upoYIXq0bJD+FMhG4+VOturFdxpXGyJVT+C1jgsbYWHuvIUYmNogtF3zqRLTThlmxlw c9uPy+Vw2NOCM075h5N9aejbzLBeXqJJujDwK9cWCbdmdsWSnQ8vsVTqPmjYmMtjGhFD mgtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uQwvF7Jw; 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 q23si14347285edb.260.2021.02.15.07.53.50; Mon, 15 Feb 2021 07:54:14 -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=uQwvF7Jw; 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 S231929AbhBOPtI (ORCPT + 99 others); Mon, 15 Feb 2021 10:49:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:45592 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231236AbhBOPb2 (ORCPT ); Mon, 15 Feb 2021 10:31:28 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2EFE264E9B; Mon, 15 Feb 2021 15:29:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613402975; bh=3bym3cGCTog7NGcDMlZLTSqV4bB0Lt4ugHn+mJrqeT8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uQwvF7JwQlRmrNaY25TSM389lmUHRH4BXW3AGr/55Y8jXnJnJikCrG9HPsGoTfTC7 JSu7MeZtrGqNGypUqYVeapEVUQ3A2LgxFwsXU1p1mt+TC21Ja3aVKmH9gbba2ECY+V stlzYp1htv7Zl8de4KaWYUIstDQmTmBTWe/ayNFY= 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 5.4 40/60] firmware_loader: align .builtin_fw to 8 Date: Mon, 15 Feb 2021 16:27:28 +0100 Message-Id: <20210215152716.647748086@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210215152715.401453874@linuxfoundation.org> References: <20210215152715.401453874@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 9a4a5a43e8867..2267b7c763c64 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -396,7 +396,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