From patchwork Fri Nov 4 07:10:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 9412009 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 DDCE86022E for ; Fri, 4 Nov 2016 07:10:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D006B2AD52 for ; Fri, 4 Nov 2016 07:10:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4A082AFBB; Fri, 4 Nov 2016 07:10:21 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 1967C2AD52 for ; Fri, 4 Nov 2016 07:10:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754345AbcKDHKO (ORCPT ); Fri, 4 Nov 2016 03:10:14 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36535 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753180AbcKDHKN (ORCPT ); Fri, 4 Nov 2016 03:10:13 -0400 Received: by mail-pf0-f195.google.com with SMTP id n85so7064883pfi.3 for ; Fri, 04 Nov 2016 00:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=ZKBdUvCWPOat+Dpxax7tRHjKV5+tm1x11cZ8Mnauaxo=; b=rt93Ndgm3PByW0+mjWUFfDVekrMgoiUTnCD7kq++zvIqxW6Q1RLA+HSogLVTSX9OQx eag+DCj3xXH0gK0aH9q56SrSa49fbCuqaEu7IUxBLOlvsrFUV1HIaXXtuahNucb7bwl7 fR/1tb+Ox9XZIEIfsdA0Yft8Z1nWc06V47kDCBmD+wM9X8zNKBGLuTtr03ir29mu6cX/ rGQbqNsbKBk/V3R1v/KSIaOfFxJXrO8ORtW7q73klqaaghmn6n1XltnTsUzZc16ysYRK enGVpaAbD0N6h7pV6ofaNDCBmYMOOBOz8XqRDIxqlUfP4YxJxl4fYToXcvhSpxU1cPb7 nSIA== 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=ZKBdUvCWPOat+Dpxax7tRHjKV5+tm1x11cZ8Mnauaxo=; b=Xl+2MFn+jNyYQTwD3/Ihj6zKc5wZZ26VzlNmvYuPV0/eDd4zt+Rq3ZbgMuObaJBnzK jfKmwJGlIWlhE6qpIGcqGmdGlRPb8A3L0SJdchHzkEedfsqHzyBTMUqEoyW1ObC7imb2 bFbxjvNIK5e8k/Rxp5a7WGFG+6MfCX8ZWccSs5xUHIvR8kYBHf63O4C1cOWs5rTJW3yu gjDP5BOETmvcXdc7oQHx18mgLOown4iJdJUGRhdornuz+qV95SxNw7Ko61ljrjQPCP6t kChKBsjL0cpAQTsZlWYjnthJSFdLa2iTnBCfQxx8kKf/XJEnkZg+Tbn3JqAuDEDltv6i rL9A== X-Gm-Message-State: ABUngveUrjwbaRX4SjKm//zOrH+NqM/ud3n7MpVI+7ZxybeL93PCWINYntrfppcB0siD5g== X-Received: by 10.98.20.131 with SMTP id 125mr24014828pfu.51.1478243412576; Fri, 04 Nov 2016 00:10:12 -0700 (PDT) Received: from roar.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id u1sm17494614pfb.96.2016.11.04.00.10.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Nov 2016 00:10:12 -0700 (PDT) From: Nicholas Piggin To: Michal Marek Cc: Nicholas Piggin , linux-kbuild@vger.kernel.org, Al Viro Subject: [PATCH] kbuild: improve linker compatibility with lib-ksyms.o build Date: Fri, 4 Nov 2016 18:10:04 +1100 Message-Id: <20161104071004.2816-1-npiggin@gmail.com> X-Mailer: git-send-email 2.9.3 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 --- Hi Michal, If we can sneak this into 4.9 it would be nice, so we don't have a release version of the kernel out there with this bug. Thanks, Nick scripts/Makefile.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 05c6bb4..fc6ebe4 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)