From patchwork Sun Jun 25 03:26:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 9807937 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 2256260329 for ; Sun, 25 Jun 2017 03:26:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 113D826E5D for ; Sun, 25 Jun 2017 03:26:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02B0427813; Sun, 25 Jun 2017 03:26:43 +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_SIGNED, 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 C9FA826E5D for ; Sun, 25 Jun 2017 03:26:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751083AbdFYD0l (ORCPT ); Sat, 24 Jun 2017 23:26:41 -0400 Received: from conssluserg-06.nifty.com ([210.131.2.91]:41562 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750944AbdFYD0l (ORCPT ); Sat, 24 Jun 2017 23:26:41 -0400 X-Greylist: delayed 149398 seconds by postgrey-1.27 at vger.kernel.org; Sat, 24 Jun 2017 23:26:40 EDT Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.161.174]) (authenticated) by conssluserg-06.nifty.com with ESMTP id v5P3QMAe008990; Sun, 25 Jun 2017 12:26:23 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com v5P3QMAe008990 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1498361183; bh=7FA5z0/TV3PPKV75+oHq20Qg/lSCUZs9nIklX1I6J4w=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=n6BbLJE98VBxT5W8vEGYxPBxUDX/H3KpqIaaBnHZTP2pcD86G58VHNjVlBLQT29H7 yVfZqDeVwEWGJRtXQ4w0PK85zIBTcMRjhg+idEqgIcmZ5NDothMbPqcedrxqBNKuxS ypmHUroKZ+uvdI+z/5BLLZ2nIIzD1zx2oROuecUIyuyOvKcGLV64RYubKdF6hUFfBD ayobcJkAh3mIOv+AmQXIelj/rMs+cdF3D3UMYuIgi7lwOWMANhi0fPbXBVIwVAiB2i pDreJaMbVtTH1yhuaRnookKBH208eyZDeZM+395TgyO9STyMnWHVoMY7PdXOXtWvQj N5Ra+MqmAO8Zg== X-Nifty-SrcIP: [209.85.161.174] Received: by mail-yw0-f174.google.com with SMTP id 63so27926201ywr.0; Sat, 24 Jun 2017 20:26:23 -0700 (PDT) X-Gm-Message-State: AKS2vOxjxPpM/Mn57quG4CQGxnVAC3W4LxzlKiR8tWurIsvdDn9ZAtv1 csrYxnfN5Dx5vEdOxoturA+Z0Fnydw== X-Received: by 10.13.224.129 with SMTP id j123mr11743988ywe.248.1498361181864; Sat, 24 Jun 2017 20:26:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.49.9 with HTTP; Sat, 24 Jun 2017 20:26:21 -0700 (PDT) In-Reply-To: <20170623234415.7d493a8d@roar.ozlabs.ibm.com> References: <20170622123929.15054-1-npiggin@gmail.com> <20170622123929.15054-3-npiggin@gmail.com> <20170623234415.7d493a8d@roar.ozlabs.ibm.com> From: Masahiro Yamada Date: Sun, 25 Jun 2017 12:26:21 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/3] ia64: thin archives fix linking To: Nicholas Piggin Cc: Linux Kbuild mailing list , Tony Luck , Fenghua Yu , linux-ia64@vger.kernel.org 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 2017-06-23 22:44 GMT+09:00 Nicholas Piggin : > On Fri, 23 Jun 2017 18:56:32 +0900 > Masahiro Yamada wrote: > >> Hi Nicholas, >> >> >> 2017-06-22 21:39 GMT+09:00 Nicholas Piggin : > > >> Without this patch, >> >> $ ia64-linux-nm -n arch/ia64/kernel/gate-syms.o >> a000000000000600 D __start_gate_mckinley_e9_patchlist >> a000000000000604 D __end_gate_mckinley_e9_patchlist >> a000000000000604 D __end_gate_vtop_patchlist >> a000000000000604 D __start_gate_fsyscall_patchlist >> a000000000000604 D __start_gate_vtop_patchlist >> a000000000000608 D __end_gate_fsyscall_patchlist >> a000000000000608 D __start_gate_brl_fsys_bubble_down_patchlist >> a00000000000060c D __end_gate_brl_fsys_bubble_down_patchlist >> a000000000040720 T __kernel_syscall_via_break >> a000000000040740 T __kernel_sigtramp >> a000000000040770 t back_from_setup_rbs >> a000000000040830 t back_from_restore_rbs >> a0000000000408a0 t setup_rbs >> a000000000040900 t restore_rbs >> a000000000040a00 T __kernel_syscall_via_epc >> >> $ ia64-linux-nm -n arch/ia64/kernel/built-in.o | grep __kernel_sigtramp >> a000000000040740 A __kernel_sigtramp >> >> >> With this patch, >> >> $ ia64-linux-nm -n arch/ia64/kernel/gate-syms.o >> 0000000000000000 A __kernel_syscall_via_break > >> 0000000000000020 A __kernel_sigtramp >> 00000000000002e0 A __kernel_syscall_via_epc >> a000000000000600 D __end_gate_brl_fsys_bubble_down_patchlist >> a000000000000600 D __end_gate_fsyscall_patchlist >> a000000000000600 D __end_gate_mckinley_e9_patchlist >> a000000000000600 D __end_gate_vtop_patchlist >> a000000000000600 D __start_gate_brl_fsys_bubble_down_patchlist >> a000000000000600 D __start_gate_fsyscall_patchlist >> a000000000000600 D __start_gate_mckinley_e9_patchlist >> a000000000000600 D __start_gate_vtop_patchlist >> >> $ ia64-linux-nm -n arch/ia64/kernel/built-in.o | grep __kernel_sigtramp >> 0000000000000020 A __kernel_sigtramp >> >> >> Could you check it? > > Sorry about this, thank you for catching it. > > This needs a dummy .o file as well. It seems we cannot do both -T and -R > operations in one step. This patch follows more like sh and tile fixes. > > Thanks, > Nick > > --- > arch/ia64/kernel/Makefile.gate | 18 ++++++++++++------ > 1 file changed, 12 insertions(+), 6 deletions(-) > > diff --git a/arch/ia64/kernel/Makefile.gate b/arch/ia64/kernel/Makefile.gate > index a32903ada016..e8ca862e7b21 100644 > --- a/arch/ia64/kernel/Makefile.gate > +++ b/arch/ia64/kernel/Makefile.gate > @@ -1,8 +1,10 @@ > # The gate DSO image is built using a special linker script. > > -targets += gate.so gate-syms.o > +targets += gate.so gate-syms.o gate-dummy.o > > -extra-y += gate.so gate-syms.o gate.lds gate.o > +obj-y += gate-syms.o > + > +extra-y += gate.so gate.lds gate.o > > CPPFLAGS_gate.lds := -P -C -U$(ARCH) > > @@ -14,13 +16,17 @@ GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 \ > $(obj)/gate.so: $(obj)/gate.lds $(obj)/gate.o FORCE > $(call if_changed,gate) > > -$(obj)/built-in.o: $(obj)/gate-syms.o > -$(obj)/built-in.o: ld_flags += -R $(obj)/gate-syms.o > +# create an object file to resolve gate symbols > +quiet_cmd_gate_syms = GATESYM $@ > + cmd_gate_syms = $(LD) -r -R $(obj)/gate-dummy.o -o $@ > > -GATECFLAGS_gate-syms.o = -r > -$(obj)/gate-syms.o: $(obj)/gate.lds $(obj)/gate.o FORCE > +GATECFLAGS_gate-dummy.o = -r > +$(obj)/gate-dummy.o: $(obj)/gate.lds $(obj)/gate.o FORCE > $(call if_changed,gate) > > +$(obj)/gate-syms.o: $(obj)/gate-dummy.o FORCE > + $(call if_changed,gate_syms) > + > # gate-data.o contains the gate DSO image as data in section .data..gate. > # We must build gate.so before we can assemble it. > # Note: kbuild does not track this dependency due to usage of .incbin > -- I replaced the patch. Thanks! I locally changed to the following part to not repeat gate-dummy.o diff --git a/arch/ia64/kernel/Makefile.gate b/arch/ia64/kernel/Makefile.gate index e8ca862..8cd125a 100644 --- a/arch/ia64/kernel/Makefile.gate +++ b/arch/ia64/kernel/Makefile.gate @@ -18,7 +18,7 @@ $(obj)/gate.so: $(obj)/gate.lds $(obj)/gate.o FORCE # create an object file to resolve gate symbols quiet_cmd_gate_syms = GATESYM $@ - cmd_gate_syms = $(LD) -r -R $(obj)/gate-dummy.o -o $@ + cmd_gate_syms = $(LD) -r -o $@ -R $< GATECFLAGS_gate-dummy.o = -r $(obj)/gate-dummy.o: $(obj)/gate.lds $(obj)/gate.o FORCE