From patchwork Mon Mar 30 11:49:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 6120441 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A4EC79F2EC for ; Mon, 30 Mar 2015 11:50:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C062A20303 for ; Mon, 30 Mar 2015 11:50:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C9439202FE for ; Mon, 30 Mar 2015 11:50:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752964AbbC3Ltz (ORCPT ); Mon, 30 Mar 2015 07:49:55 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:36098 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752873AbbC3Ltn (ORCPT ); Mon, 30 Mar 2015 07:49:43 -0400 Received: by wibg7 with SMTP id g7so99794732wib.1 for ; Mon, 30 Mar 2015 04:49:42 -0700 (PDT) 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:in-reply-to :references; bh=J1LKSDvn+R9ZBDVLaGDEKsAJvfpuqdrhh9zXWoIOQj4=; b=IPDddh5C3Tlbg0w+tOrvbSHNSMYpZb5m9mPjE60K0o0THCZ+4wY3L22GSf7/+jJWLb GnJ537Ji3LnD3zJZAMb9F6em2x4TsnRG2WmHaMgfjk3V8E2BQuJ/8UPsj7dAtpg65bwN +yE+JHxwsO1ztn2r0X2z15U4Dl0gkDwTWuOUKMKTPbVClLgTmIS3IFjuV7cYYvPlwjc2 x4ifrg2NicjQsa31hK9qGnWaVXrm0rV7QxkwvodyHmnhSChGmsABrx0m5F0VTq89SD/F YKO/Wims+20QsvXD79S9PsNESxBZern/yAaxJpVD+hUPXGQPi6V2/EmEKOOC0TDyFjdN ZPvg== X-Gm-Message-State: ALoCoQkoI1Kc03ui2Y8qL+ph27BNPJbPaF3Af6bGdKy9HgIyuwH4trUhUTnvoyMotv/Lcsckt07x X-Received: by 10.195.11.73 with SMTP id eg9mr61478800wjd.62.1427716181971; Mon, 30 Mar 2015 04:49:41 -0700 (PDT) Received: from ards-macbook-pro.local (129.20.90.92.rev.sfr.net. [92.90.20.129]) by mx.google.com with ESMTPSA id md2sm15976347wic.19.2015.03.30.04.49.39 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Mar 2015 04:49:41 -0700 (PDT) From: Ard Biesheuvel To: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, arnd@arndb.de, mmarek@suse.cz, linux@arm.linux.org.uk Cc: Ard Biesheuvel Subject: [RFC PATCH 2/2] Kbuild: avoid partial linking of drivers/built-in.o Date: Mon, 30 Mar 2015 13:49:27 +0200 Message-Id: <1427716167-25078-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1427716167-25078-1-git-send-email-ard.biesheuvel@linaro.org> References: <1427716167-25078-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The recursive partial linking of vmlinux can result in a drivers/built-in.o that is so huge that it interferes with the ability of the linker to emit veneers in the final link stage if the symbols are out of reach. This is caused by the fact that those veneers, which should be emitted close enough to the original call site, can only be emitted after the .text section of drivers/built-in.o, whose size pushes those veneers out of range. So instead, avoid building drivers/built-in.o, and instead, add the constituent parts to the command line of the final link. Signed-off-by: Ard Biesheuvel --- Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e734965b1604..1eb6c246a586 100644 --- a/Makefile +++ b/Makefile @@ -558,7 +558,7 @@ scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \ # Objects we will link into vmlinux / subdirs we need to visit init-y := init/ -drivers-y := drivers/ sound/ firmware/ +drivers-y := sound/ firmware/ net-y := net/ libs-y := lib/ core-y := usr/ @@ -569,6 +569,16 @@ ifeq ($(dot-config),1) -include include/config/auto.conf ifeq ($(KBUILD_EXTMOD),) + +# drivers/built-in.o can become huge, which interferes with the linker's +# ability to emit stubs for branch targets that are out of reach for the +# ordinary relative branch instructions +include $(srctree)/drivers/Makefile +drivers-y += $(addprefix drivers/,$(sort $(obj-y))) +drivers-m += $(addprefix drivers/,$(sort $(obj-m))) +obj-y := +obj-m := + # Read in dependencies to all Kconfig* files, make sure to run # oldconfig if changes are detected. -include include/config/auto.conf.cmd