From: Nicholas Piggin <npiggin@gmail.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
Tony Luck <tony.luck@intel.com>,
Fenghua Yu <fenghua.yu@intel.com>,
linux-ia64@vger.kernel.org
Subject: Re: [PATCH v2 2/3] ia64: thin archives fix linking
Date: Fri, 23 Jun 2017 13:44:15 +0000 [thread overview]
Message-ID: <20170623234415.7d493a8d@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <CAK7LNATX=Mvu1PtHQOnkwr2D9wc4cFJEOoTPgOK2t=026i8OKg@mail.gmail.com>
On Fri, 23 Jun 2017 18:56:32 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
> Hi Nicholas,
>
>
> 2017-06-22 21:39 GMT+09:00 Nicholas Piggin <npiggin@gmail.com>:
> 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
--
2.11.0
next prev parent reply other threads:[~2017-06-23 13:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170622123929.15054-1-npiggin@gmail.com>
2017-06-22 12:39 ` [PATCH v2 2/3] ia64: thin archives fix linking Nicholas Piggin
2017-06-23 9:56 ` Masahiro Yamada
2017-06-23 13:44 ` Nicholas Piggin [this message]
2017-06-25 3:26 ` Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170623234415.7d493a8d@roar.ozlabs.ibm.com \
--to=npiggin@gmail.com \
--cc=fenghua.yu@intel.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=tony.luck@intel.com \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox