From patchwork Wed Nov 23 16:41:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 9443779 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D53256075F for ; Wed, 23 Nov 2016 16:42:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD7EE1FE83 for ; Wed, 23 Nov 2016 16:42:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0EFC27BE5; Wed, 23 Nov 2016 16:42:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A3AF1FE83 for ; Wed, 23 Nov 2016 16:42:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934444AbcKWQmQ (ORCPT ); Wed, 23 Nov 2016 11:42:16 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:36306 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934445AbcKWQmN (ORCPT ); Wed, 23 Nov 2016 11:42:13 -0500 Received: by mail-pg0-f66.google.com with SMTP id x23so1425150pgx.3 for ; Wed, 23 Nov 2016 08:42:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vjwfO73I0nUYsTnEK608L8iGsUNI7vIJJZyoPnyTxnQ=; b=w7a1Eklj6qex4xBZzLbrzQsJbTVw5vgdFXoZ32Dcqn9tmisXnROZBbgV0xMZi+uq2i SWiM8Gqvyy1HjRe3Cj8dHGYbzttKpHnuJJlJxBnMnz1r1FjxDyGA0RiscBccx21jioDS U+ype6BeEfINg+0yGdm8ElHCBlFhsBztqt1S3H0ZUPh4GSLRRS3cPjtdzzqx+QcLQhqg etq0Ny94dn+mmUAimJF14dhLNrf28vrNGgfQ285QHXem2dhBrnlm2tyonbojM953NjvU RHy9SL1672asIqx9PqCKWmp/uOPFtafF4O++6+kAvTRGHm9sPnKVjP+jX3dNHL6pCgTe HGkw== 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=vjwfO73I0nUYsTnEK608L8iGsUNI7vIJJZyoPnyTxnQ=; b=fdSknDuR92z9EMIyHEuT1woKDgUm2g5rlB5QBuiZqh/KwliOXISjWV+H82jG8rpjMX 2Vf+lgpOHmmXVz5xyp3H5uKRfQjkEtnbR7nmYl0/DFQm0CCbLSmutssYODBV526z0RX8 7UgeeUuCQpEkr8mepQPEFTZX3aAN97sB1cheKri9BpNmTHjmRwazuffDeFXwqPLVckdy 4gUQp++f1lWYloOeXg0igFMD0VhaBICsNuZeDbUqiDzMXJvtyfnXiUPj9GYvp4EAx7yK BjjI6b9VfJPPKsc9FUkplMd4GDO/HX/crGwVkjNx+gd7hFtWsolZZx3U8nE52eG9ATdj VeDg== X-Gm-Message-State: AKaTC02lFDjGR5C4hNwfey/wgDd8LYO6mAWHEUaYFyhEkyt+fVX9i8uGvyHDOMpgiTtN7A== X-Received: by 10.99.126.6 with SMTP id z6mr6642933pgc.182.1479919332819; Wed, 23 Nov 2016 08:42:12 -0800 (PST) Received: from roar.au.ibm.com (27-33-21-189.tpgi.com.au. [27.33.21.189]) by smtp.gmail.com with ESMTPSA id o26sm53959762pfk.91.2016.11.23.08.42.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Nov 2016 08:42:12 -0800 (PST) From: Nicholas Piggin To: Michal Marek Cc: Nicholas Piggin , linux-kbuild@vger.kernel.org Subject: [PATCH 4/7] kbuild: improve linker compatibility with lib-ksyms.o build Date: Thu, 24 Nov 2016 03:41:40 +1100 Message-Id: <20161123164143.16839-5-npiggin@gmail.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161123164143.16839-1-npiggin@gmail.com> References: <20161123164143.16839-1-npiggin@gmail.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP lib-ksyms.o is created by linking an empty input file with a linker script containing the interesting bits. Currently the empty input file is an archive containing nothing, however this causes the gold linker to segfault. I have opened a bug against gold https://sourceware.org/bugzilla/show_bug.cgi?id=20767 However this can be worked around by assembling an empty file to link with instead. The resulting lib-ksyms.o is slightly larger (seemingly due to empty .text, .data, .bss setions added), but final linked output should not be changed. Reported-by: Anton Blanchard Signed-off-by: Nicholas Piggin --- scripts/Makefile.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 41d2901..8925209 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -490,7 +490,7 @@ quiet_cmd_export_list = EXPORTS $@ cmd_export_list = $(OBJDUMP) -h $< | \ sed -ne '/___ksymtab/{s/.*+/$(ref_prefix)/;s/ .*/)/;p}' >$(ksyms-lds);\ rm -f $(dummy-object);\ - $(AR) rcs$(KBUILD_ARFLAGS) $(dummy-object);\ + echo | $(CC) $(a_flags) -c -o $(dummy-object) -x assembler -;\ $(LD) $(ld_flags) -r -o $@ -T $(ksyms-lds) $(dummy-object);\ rm $(dummy-object) $(ksyms-lds)