Received: by 10.213.65.68 with SMTP id h4csp462587imn; Fri, 16 Mar 2018 08:29:40 -0700 (PDT) X-Google-Smtp-Source: AG47ELvAeUuZ4bl1DD66NNsnW766BGPkMVSpbjoM4do4oQhLuBxhNLa7MrEol8ncMTlEaXaSBfS3 X-Received: by 2002:a17:902:aa8d:: with SMTP id d13-v6mr2643403plr.378.1521214180533; Fri, 16 Mar 2018 08:29:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521214180; cv=none; d=google.com; s=arc-20160816; b=Hd+piVnbGtxZzZDrQuJfXz1lI3vEBR2iiFT/k+RPN3helh0hNIMJ3qqsOF4LJHby4t 3tcCV9bnjX54fEz607KdkYxOS/5Xf+ZIsFhtZB2LQHTlDjxgI3iGcSQ6SwdQ5fZRgunB A8N+G/l1CKiXHNC/KYe35tbSlKk2ynAmfAXFv22/nFsTfUnQ68gR/aI9GVWgYbe6ZzQ2 HzOP4CKyAgYNVq723sDlT9yLJwZB835MMXrfaThr55LqiwKAZw6fBr3v8UOkJlDPiuK4 BvrMOwCrCegZnkBVi2nQvV8xb5qFPwuXtuqa1+1OH6SKp/CzhHiWZpiqTPsqDAHE+Eh9 IZ2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=B6f7yUlgEad58RRW7z8UibXqv/Y7Osc/W5IHAf2vWfw=; b=OYGECVrP/NXvlsA6x2rNXuLcwtQ2o5sGgtQQRwfnvUA1sysX2gRs/2jTi+0S/lA+S6 KHmse6IKw/IV10PctzyGObra1KOZulzq6CvKSo8urz4+vkWij+Xr13c/BucpkYjActYq BD2Vx6977zopnvOXXhd6zlvkC49lQEj5TA3oVxF/p4d2+pgDfJpGeYN9i1nzsJw9UkpP glhC9RCVGAylkhQk1d/DXsmwu1hA8zptYTStgx3k8F9JrOPtQb2txOA+KULWgfKX6Qqp ABtJcfBK+gfDi/cwRfy1vbd1/XeRARClpvpKAGTX9N6oC61oq065J2wS3hk1AeFicNtn t5CQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3-v6si6261288plo.746.2018.03.16.08.29.25; Fri, 16 Mar 2018 08:29:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932895AbeCPP2j (ORCPT + 99 others); Fri, 16 Mar 2018 11:28:39 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35732 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932856AbeCPP2f (ORCPT ); Fri, 16 Mar 2018 11:28:35 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 44D4AD93; Fri, 16 Mar 2018 15:28:34 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Hogan , Frank Rowand , Rob Herring , Michal Marek , Ralf Baechle , Florian Fainelli , Kevin Cernekee , Masahiro Yamada Subject: [PATCH 4.4 18/63] kbuild: Handle builtin dtb file names containing hyphens Date: Fri, 16 Mar 2018 16:22:50 +0100 Message-Id: <20180316152302.085094735@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152259.964532775@linuxfoundation.org> References: <20180316152259.964532775@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: James Hogan commit 55fe6da9efba102866e2fb5b40b04b6a4b26c19e upstream. cmd_dt_S_dtb constructs the assembly source to incorporate a devicetree FDT (that is, the .dtb file) as binary data in the kernel image. This assembly source contains labels before and after the binary data. The label names incorporate the file name of the corresponding .dtb file. Hyphens are not legal characters in labels, so .dtb files built into the kernel with hyphens in the file name result in errors like the following: bcm3368-netgear-cvg834g.dtb.S: Assembler messages: bcm3368-netgear-cvg834g.dtb.S:5: Error: : no such section bcm3368-netgear-cvg834g.dtb.S:5: Error: junk at end of line, first unrecognized character is `-' bcm3368-netgear-cvg834g.dtb.S:6: Error: unrecognized opcode `__dtb_bcm3368-netgear-cvg834g_begin:' bcm3368-netgear-cvg834g.dtb.S:8: Error: unrecognized opcode `__dtb_bcm3368-netgear-cvg834g_end:' bcm3368-netgear-cvg834g.dtb.S:9: Error: : no such section bcm3368-netgear-cvg834g.dtb.S:9: Error: junk at end of line, first unrecognized character is `-' Fix this by updating cmd_dt_S_dtb to transform all hyphens from the file name to underscores when constructing the labels. As of v4.16-rc2, 1139 .dts files across ARM64, ARM, MIPS and PowerPC contain hyphens in their names, but the issue only currently manifests on Broadcom MIPS platforms, as that is the only place where such files are built into the kernel. For example when CONFIG_DT_NETGEAR_CVG834G=y, or on BMIPS kernels when the dtbs target is used (in the latter case it admittedly shouldn't really build all the dtb.o files, but thats a separate issue). Fixes: 695835511f96 ("MIPS: BMIPS: rename bcm96358nb4ser to bcm6358-neufbox4-sercom") Signed-off-by: James Hogan Reviewed-by: Frank Rowand Cc: Rob Herring Cc: Michal Marek Cc: Ralf Baechle Cc: Florian Fainelli Cc: Kevin Cernekee Cc: # 4.9+ Signed-off-by: Masahiro Yamada Signed-off-by: Greg Kroah-Hartman --- scripts/Makefile.lib | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -270,11 +270,11 @@ cmd_dt_S_dtb= \ echo '\#include '; \ echo '.section .dtb.init.rodata,"a"'; \ echo '.balign STRUCT_ALIGNMENT'; \ - echo '.global __dtb_$(*F)_begin'; \ - echo '__dtb_$(*F)_begin:'; \ + echo '.global __dtb_$(subst -,_,$(*F))_begin'; \ + echo '__dtb_$(subst -,_,$(*F))_begin:'; \ echo '.incbin "$<" '; \ - echo '__dtb_$(*F)_end:'; \ - echo '.global __dtb_$(*F)_end'; \ + echo '__dtb_$(subst -,_,$(*F))_end:'; \ + echo '.global __dtb_$(subst -,_,$(*F))_end'; \ echo '.balign STRUCT_ALIGNMENT'; \ ) > $@