Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp643757pxu; Thu, 3 Dec 2020 09:08:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNZP3SjQhOcjQ9KSrLJpkFTxLsq7btxkY393FyyE+pwzWGWybv0aLLRavXV/tkqxqs76Su X-Received: by 2002:a17:906:268c:: with SMTP id t12mr3338852ejc.91.1607015320172; Thu, 03 Dec 2020 09:08:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607015320; cv=none; d=google.com; s=arc-20160816; b=aeL6OYjVXFyIgZjCRrpqUOyM3mRbbXNA05iiW9RwTikItVq9uvTP91MMAssWF2ld0r R7ZpDf3ORYo61bB2anctdlzee7URKbgOQpuG55tfvRAeiZQnYOAm6h+tHVKKDlDuOqbr 0uo76Nt/Uus9WaqQNSax/8cghIvQSxn9IwUn//AlZxmeU4WS5HamSK7wCwqUX7PLuudn AZBsnoBqb7y3O46Qws6UkGaqJj4ZTNXdcqFZc7EXvNN4O762EOHNXmNBUKNe6Tms/mbI w+4Sd6aFegN6qrnNitpn4ZZ03HYmHQyoQZtlkOnKC79fDj4OjwxiL+ExwHqqoNqiogmr CHGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :sender:dkim-signature; bh=Qbrb8i2YfiEPDxlw+wvNXikUmpcEcy9BW/zou/d27Yk=; b=gZ/0r81oHbBmBd4C98V5o7UhkA1sDGgaiZion79HZG6uXQdrZ1kfwojbvrtuQTirvr h9bhIWO7OsXCiBBpCEBnPlE1SpngCjuxQPM8n8hUbUPFgjYx2xpGZe49saC9ELE0rI+P 2gO8ijtoofEtlgJdjm5eyIk7anw3OvrE9nARA8H3qrOW5o211eQ1Wr+rASXicDfmEkoy Qns3Yh1uL3f+rj8vePme7HZ0YBqsfsu9hBrm7c/tmYJU7+0DnYYR07Qx/9FO8ioYiksh ackIddBGWHy+KssC9RF6C1X0wUhCdT/rhguUjKVqp+Z/km0eCSdrGEAn0hSFyg+R4Bky YitA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="ePOWK2/6"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u9si1272006edr.63.2020.12.03.09.08.12; Thu, 03 Dec 2020 09:08:40 -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=@google.com header.s=20161025 header.b="ePOWK2/6"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730935AbgLCRGd (ORCPT + 99 others); Thu, 3 Dec 2020 12:06:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726744AbgLCRGd (ORCPT ); Thu, 3 Dec 2020 12:06:33 -0500 Received: from mail-qt1-x849.google.com (mail-qt1-x849.google.com [IPv6:2607:f8b0:4864:20::849]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1369CC061A4E for ; Thu, 3 Dec 2020 09:05:53 -0800 (PST) Received: by mail-qt1-x849.google.com with SMTP id j1so1567593qtd.13 for ; Thu, 03 Dec 2020 09:05:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=Qbrb8i2YfiEPDxlw+wvNXikUmpcEcy9BW/zou/d27Yk=; b=ePOWK2/6kYVxket/SF6GfcbuPmPOmPzeA0baqmNP01ITblvLvShxFFmoPKNtQzqnFS Ei4LY+4oiS1Imvj50qvIeZ36Eey3/jBj55dZ2Aqzy3cCb6pfDMjo7i/EorJB8qqI6IHD fDXsbdfkGNlDikFblIPQX6pBzHAMcsH2pFYtJk3yX/xR88kg0xj5p5SsEw+evXlB2Weh 8MlQMNjgMg3ZyF+SM5K3RFg/t+ueLH0avRip+UruPkJMHnoAtkqQbheRgLVFuyQ4zI0j 5LOonZvHwrKTAthhe+z/0qOfrBebuMfH8Dmmvw4YMV7Tbg4Ev848ay/N3eEVwuzabYAo w6Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=Qbrb8i2YfiEPDxlw+wvNXikUmpcEcy9BW/zou/d27Yk=; b=oRPrUnPwRXNuEh5ri5GYaOIvupOBYXm/wYuifq7GAEKxKZDbW2LQ2xhSUZPL+7TZq5 SmNsD1fwSHkhjUHvKf5EG5Pwz9G61EJglhRBCZtr9jki+hqvEAA7cNayQzNga2iTPLLf DCdWDjAJMQuxTzpRqRlikOuknuBJXy6Qlhvl7CuM1WLIFJD8Q3GVpVMr0PTycZPjx9Kf +wvbsShDv2oKXth+8YFl2LZEalPs7CJNBvs08TPkAJlDYrycJgiE6BTHob3yeaD2tIhS Wc51WU91a40Wpqrarl5FqLPK/WysBH0pgb15jsJU7ivMF/piSFOfqOoPAu4WjO8SPw7N V1wA== X-Gm-Message-State: AOAM533v664SjjIziM02l0gRLjW9yPVjjxso8RUepQrjnKiKdFRgVX2H XBO5qNhLNZPHaJgHs1MS75sP6aOOTTtR Sender: "maskray via sendgmr" X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:0:a6ae:11ff:fe11:4abb]) (user=maskray job=sendgmr) by 2002:a0c:b18a:: with SMTP id v10mr4180101qvd.46.1607015152255; Thu, 03 Dec 2020 09:05:52 -0800 (PST) Date: Thu, 3 Dec 2020 09:05:29 -0800 Message-Id: <20201203170529.1029105-1-maskray@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.29.2.576.ga3fc446d84-goog Subject: [PATCH] firmware_loader: Align .builtin_fw to 8 From: Fangrui Song To: Arnd Bergmann , linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor , Nick Desaulniers , Fangrui Song , kernel test robot Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Fixes: 5658c76 ("firmware: allow firmware files to be built into kernel image") Link: https://github.com/ClangBuiltLinux/linux/issues/1204 Reported-by: kernel test robot Signed-off-by: Fangrui Song --- include/asm-generic/vmlinux.lds.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index b2b3d81b1535..3cd4bd1193ab 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -459,6 +459,7 @@ } \ \ /* Built-in firmware blobs */ \ + ALIGN_FUNCTION(); \ .builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) { \ __start_builtin_fw = .; \ KEEP(*(.builtin_fw)) \ -- 2.29.2.576.ga3fc446d84-goog