From patchwork Fri Feb 5 10:25:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 61264 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1001155lbl; Fri, 5 Feb 2016 02:26:14 -0800 (PST) X-Received: by 10.66.55.73 with SMTP id q9mr18742206pap.44.1454667974362; Fri, 05 Feb 2016 02:26:14 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q73si23110044pfq.209.2016.02.05.02.26.13; Fri, 05 Feb 2016 02:26:14 -0800 (PST) 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; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752867AbcBEK0M (ORCPT + 30 others); Fri, 5 Feb 2016 05:26:12 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:36382 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752459AbcBEKZa (ORCPT ); Fri, 5 Feb 2016 05:25:30 -0500 Received: by mail-wm0-f54.google.com with SMTP id p63so19885570wmp.1 for ; Fri, 05 Feb 2016 02:25:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=SHhxPUrsaEXDu768zFqHIRB0JhmZumR0sRfuF4ekikY=; b=ezz/S30EGb2iPxkCdtTc9W6HcUXhKBbneNLN73K4jJoejqasE5rcxD+lIAQwl0lxKn GQ/LVMLrjY1V7rGrqcNhgk2sulvlCKkhBlSDo2hpMBxz68gyzKn0va6fv2qejVUAs+08 wJzltltJnIP2m5IT5rgQT8Jj/sP9RnuWur+K4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=SHhxPUrsaEXDu768zFqHIRB0JhmZumR0sRfuF4ekikY=; b=Qd6qIurBx+i+feOhqdgZxu6fmJ7M7ExiAsH2FeiyE1+Kaua0mHtnF/1xa/H2lPkflG JZGsH3rX8c0hDnUl6d539RLDNg6QDCvYWgTkSCex83xrt01TnXrofMXgzgTB+2orSH8T bV7coWWhDoBWjIMr5DVsDKrG6ZilvcNGyPKkmg+kAivlWor40goYx4+BKzdCNhBXLUwB 5EUpAZoD4ofn0QPRGhP8StZ077Yh1OyXBCJmmkXeNWcII/Xsc5gQ9zAFbykBhumDCf+b LMc107xuKEqY5RgkYt1sKonxdxGqm3IdsjQl0uh9zhltQ/vcFOsnF55AIbMRQaAE037S 9Arw== X-Gm-Message-State: AG10YOTEWVPnXbOGmwF+Sj5dwHkk6i8pJqn7ds0+HSUaDETP1aBNGtR4c6V7eAulT+SyqfjH X-Received: by 10.194.121.70 with SMTP id li6mr13012384wjb.33.1454667928974; Fri, 05 Feb 2016 02:25:28 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id lm5sm6328062wjc.12.2016.02.05.02.25.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Feb 2016 02:25:28 -0800 (PST) From: Ard Biesheuvel To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux@roeck-us.net, arnd@arndb.de, mmarek@suse.cz Cc: rusty@rustcorp.com.au, Ard Biesheuvel Subject: [PATCH v2] scripts/link-vmlinux.sh: force error on kallsyms failure Date: Fri, 5 Feb 2016 11:25:05 +0100 Message-Id: <1454667905-23003-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since the output of the invocation of scripts/kallsyms is piped directly into the assembler, error messages it emits are visible on stderr, but a non-zero return code is ignored, and the build simply proceeds in that case. However, the resulting kernel is most likely broken, and will crash at boot. So instead, capture the output of kallsyms in a separate .S file, and pass that to the assembler in a separate step. Signed-off-by: Ard Biesheuvel --- scripts/link-vmlinux.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.5.0 diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index b83f918c7830..4846ecb9764c 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -93,9 +93,10 @@ kallsyms() local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \ ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}" - ${NM} -n ${1} | \ - scripts/kallsyms ${kallsymopt} | \ - ${CC} ${aflags} -c -o ${2} -x assembler-with-cpp - + local afile="`basename ${2} .o`.S" + + ${NM} -n ${1} | scripts/kallsyms ${kallsymopt} > ${afile} + ${CC} ${aflags} -c -o ${2} ${afile} } # Create map file with all symbols from ${1}