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: 46506 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D38052159A for ; Mon, 30 Mar 2015 11:50:05 +0000 (UTC) Received: by iesy4 with SMTP id y4sf203862803ies.0 for ; Mon, 30 Mar 2015 04:50:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=eCHFzRx2RKtCcecEvjHyvTBeMm7SOua9wg/IBnHXrFs=; b=KfWcFGToUnGtjvGIvI/R7jcCxEf+Rycvb0WYU00WTL/x1Jlj5/EdkMXI1QO0bkd3xl z8X1ocBfiPOqN3B45NUB2RxEUfO+44sFzWz5QhQwnklo6o7XtVD82i5Q1fuvvL9z2k6C IBAtiyz6ofdIjqq2448amRDaznXEPHf3kTj9yENlhX2DpdMnZe4H21ZKj2TsqWPZYwRr X31VDA9QUjhN8/LTpdSkMCLcu9r/bW8jk6Go1lmC+lNSkVmKxsi+Fm2gnaZ9IBbBTNke MNWjIR2rfSqZjCs6LNZQZZmN9ozRErjWXkMBIpHzkmGFx3DgCeQXGLjbXnTvc1AQUnrd +yaw== X-Gm-Message-State: ALoCoQm/hWjcGIHJmQ6JfQTehFgy4Ar3/JlO0hIZNqs65e492uKfYp8xLDqsdcqO3D00PymSs6to X-Received: by 10.43.152.9 with SMTP id ku9mr48835406icc.8.1427716205492; Mon, 30 Mar 2015 04:50:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.25.139 with SMTP id 11ls2056376qgt.82.gmail; Mon, 30 Mar 2015 04:50:05 -0700 (PDT) X-Received: by 10.55.42.37 with SMTP id q37mr66250430qkh.90.1427716205399; Mon, 30 Mar 2015 04:50:05 -0700 (PDT) Received: from mail-qg0-f44.google.com (mail-qg0-f44.google.com. [209.85.192.44]) by mx.google.com with ESMTPS id y70si10066000qgd.103.2015.03.30.04.50.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Mar 2015 04:50:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.192.44 as permitted sender) client-ip=209.85.192.44; Received: by qgh3 with SMTP id 3so169168782qgh.2 for ; Mon, 30 Mar 2015 04:50:05 -0700 (PDT) X-Received: by 10.140.82.7 with SMTP id g7mr35709373qgd.42.1427716205261; Mon, 30 Mar 2015 04:50:05 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.96.155.231 with SMTP id vz7csp1399515qdb; Mon, 30 Mar 2015 04:50:04 -0700 (PDT) X-Received: by 10.66.66.230 with SMTP id i6mr57276253pat.108.1427716204095; Mon, 30 Mar 2015 04:50:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d15si14484173pdl.13.2015.03.30.04.50.01; Mon, 30 Mar 2015 04:50:04 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752985AbbC3Ltz (ORCPT + 27 others); Mon, 30 Mar 2015 07:49:55 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:34851 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752878AbbC3Ltn (ORCPT ); Mon, 30 Mar 2015 07:49:43 -0400 Received: by wicne17 with SMTP id ne17so27970507wic.0 for ; Mon, 30 Mar 2015 04:49:42 -0700 (PDT) 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-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.192.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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