Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754283AbcKQA2o (ORCPT ); Wed, 16 Nov 2016 19:28:44 -0500 Received: from mail-qt0-f181.google.com ([209.85.216.181]:36445 "EHLO mail-qt0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751652AbcKQA2l (ORCPT ); Wed, 16 Nov 2016 19:28:41 -0500 Date: Wed, 16 Nov 2016 19:28:39 -0500 (EST) From: Nicolas Pitre To: Michal Marek cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: cmd_export_list: tighten the sed script Message-ID: User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 828 Lines: 27 When LTO is used, some ___ksymtab_string sections are seen by this sed script, creating lines containing a single ) such as: EXPORT(foo) ) ) EXPORT(bar) Let's make it so the + character is also required for any line to be printed. Signed-off-by: Nicolas Pitre diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 53b43f26bb..3066c8e61d 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -428,7 +428,7 @@ endif quiet_cmd_export_list = EXPORTS $@ cmd_export_list = $(OBJDUMP) -h $< | \ - sed -ne '/___ksymtab/{s/.*+/$(ref_prefix)/;s/ .*/)/;p}' >$(ksyms-lds);\ + sed -ne '/___ksymtab/s/.*+\([^ ]*\).*/$(ref_prefix)\1)/p' >$(ksyms-lds);\ rm -f $(dummy-object);\ $(AR) rcs$(KBUILD_ARFLAGS) $(dummy-object);\ $(LD) $(ld_flags) -r -o $@ -T $(ksyms-lds) $(dummy-object);\