* [PATCH v2 0/3] fix ia64, tile, sh for thin archives
@ 2017-06-22 12:39 Nicholas Piggin
2017-06-22 12:39 ` [PATCH v2 1/3] sh: thin archives fix linking Nicholas Piggin
` (3 more replies)
0 siblings, 4 replies; 15+ messages in thread
From: Nicholas Piggin @ 2017-06-22 12:39 UTC (permalink / raw)
To: Masahiro Yamada; +Cc: Nicholas Piggin, linux-kbuild
This is a re-work of the vdso symbol linking patches to avoid the
problem,
ld: warning: .note.gnu.build-id section discarded, --build-id ignored.
I was able to reproduce the problem, and I have compiled
defconfig for 3 architectures here with this new approach
and I saw no problems.
Please replace the existing patches in kbuild/thin-ac with these
3 if you agree with them.
Thanks,
Nick
Nicholas Piggin (3):
sh: thin archives fix linking
ia64: thin archives fix linking
tile: thin archives fix linking
arch/ia64/kernel/Makefile.gate | 12 +++++++-----
arch/sh/kernel/vsyscall/Makefile | 16 +++++++++-------
arch/tile/kernel/vdso/Makefile | 14 ++++++++------
3 files changed, 24 insertions(+), 18 deletions(-)
--
2.11.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 1/3] sh: thin archives fix linking
2017-06-22 12:39 [PATCH v2 0/3] fix ia64, tile, sh for thin archives Nicholas Piggin
@ 2017-06-22 12:39 ` Nicholas Piggin
2017-06-23 3:25 ` Masahiro Yamada
2017-06-22 12:39 ` [PATCH v2 2/3] ia64: " Nicholas Piggin
` (2 subsequent siblings)
3 siblings, 1 reply; 15+ messages in thread
From: Nicholas Piggin @ 2017-06-22 12:39 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Nicholas Piggin, linux-kbuild, Yoshinori Sato, Rich Felker,
linux-sh
The VDSO symbols can't be linked into built-in.o when building with
thin archives, so change this to linking a new object file that is
included into the built-in.o.
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: linux-sh@vger.kernel.org
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/sh/kernel/vsyscall/Makefile | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/arch/sh/kernel/vsyscall/Makefile b/arch/sh/kernel/vsyscall/Makefile
index 8f0ea5fc835c..efc7a6837ef6 100644
--- a/arch/sh/kernel/vsyscall/Makefile
+++ b/arch/sh/kernel/vsyscall/Makefile
@@ -1,4 +1,4 @@
-obj-y += vsyscall.o vsyscall-syscall.o
+obj-y += vsyscall.o vsyscall-syscall.o vsyscall-syms.o
$(obj)/vsyscall-syscall.o: \
$(foreach F,trapa,$(obj)/vsyscall-$F.so)
@@ -26,11 +26,13 @@ $(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE
# We also create a special relocatable object that should mirror the symbol
# table and layout of the linked DSO. With ld -R we can then refer to
# these symbols in the kernel code rather than hand-coded addresses.
-extra-y += vsyscall-syms.o
-$(obj)/built-in.o: $(obj)/vsyscall-syms.o
-$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o
-
-SYSCFLAGS_vsyscall-syms.o = -r
-$(obj)/vsyscall-syms.o: $(src)/vsyscall.lds \
+SYSCFLAGS_vsyscall-dummy.o = -r
+$(obj)/vsyscall-dummy.o: $(src)/vsyscall.lds \
$(obj)/vsyscall-trapa.o $(obj)/vsyscall-note.o FORCE
$(call if_changed,syscall)
+
+quiet_cmd_syscall_syms = SYSCALL $@
+ cmd_syscall_syms = $(LD) -r -R $(obj)/vsyscall-dummy.o -o $@
+
+$(obj)/vsyscall-syms.o: $(obj)/vsyscall-dummy.o
+ $(call if_changed,syscall_syms)
--
2.11.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 2/3] ia64: thin archives fix linking
2017-06-22 12:39 [PATCH v2 0/3] fix ia64, tile, sh for thin archives Nicholas Piggin
2017-06-22 12:39 ` [PATCH v2 1/3] sh: thin archives fix linking Nicholas Piggin
@ 2017-06-22 12:39 ` Nicholas Piggin
2017-06-23 9:56 ` Masahiro Yamada
2017-06-22 12:39 ` [PATCH v2 3/3] tile: " Nicholas Piggin
2017-06-23 3:23 ` [PATCH v2 0/3] fix ia64, tile, sh for thin archives Masahiro Yamada
3 siblings, 1 reply; 15+ messages in thread
From: Nicholas Piggin @ 2017-06-22 12:39 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Nicholas Piggin, linux-kbuild, Tony Luck, Fenghua Yu, linux-ia64
The VDSO symbols can't be linked into built-in.o when building with
thin archives, so change this to linking a new object file that is
included into the built-in.o.
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: linux-ia64@vger.kernel.org
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/ia64/kernel/Makefile.gate | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/arch/ia64/kernel/Makefile.gate b/arch/ia64/kernel/Makefile.gate
index a32903ada016..e20c711c2b1e 100644
--- a/arch/ia64/kernel/Makefile.gate
+++ b/arch/ia64/kernel/Makefile.gate
@@ -2,7 +2,9 @@
targets += gate.so gate-syms.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,12 +16,12 @@ 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 -T $(obj)/gate.lds -R $(obj)/gate.o -o $@
-GATECFLAGS_gate-syms.o = -r
$(obj)/gate-syms.o: $(obj)/gate.lds $(obj)/gate.o FORCE
- $(call if_changed,gate)
+ $(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.
--
2.11.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 3/3] tile: thin archives fix linking
2017-06-22 12:39 [PATCH v2 0/3] fix ia64, tile, sh for thin archives Nicholas Piggin
2017-06-22 12:39 ` [PATCH v2 1/3] sh: thin archives fix linking Nicholas Piggin
2017-06-22 12:39 ` [PATCH v2 2/3] ia64: " Nicholas Piggin
@ 2017-06-22 12:39 ` Nicholas Piggin
2017-06-25 3:28 ` Masahiro Yamada
2017-06-23 3:23 ` [PATCH v2 0/3] fix ia64, tile, sh for thin archives Masahiro Yamada
3 siblings, 1 reply; 15+ messages in thread
From: Nicholas Piggin @ 2017-06-22 12:39 UTC (permalink / raw)
To: Masahiro Yamada; +Cc: Nicholas Piggin, linux-kbuild, Chris Metcalf
The VDSO symbols can't be linked into built-in.o when building with
thin archives, so change this to linking a new object file that is
included into the built-in.o.
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/tile/kernel/vdso/Makefile | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/arch/tile/kernel/vdso/Makefile b/arch/tile/kernel/vdso/Makefile
index c54fff37b5ff..e140472d5be6 100644
--- a/arch/tile/kernel/vdso/Makefile
+++ b/arch/tile/kernel/vdso/Makefile
@@ -11,7 +11,7 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
# vdso32 is only for tilegx -m32 compat task.
VDSO32-$(CONFIG_COMPAT) := y
-obj-y += vdso.o
+obj-y += vdso.o vdso-syms.o
obj-$(VDSO32-y) += vdso32.o
extra-y += vdso.lds
CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
@@ -49,16 +49,18 @@ $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso)
# We also create a special relocatable object that should mirror the symbol
# table and layout of the linked DSO. With ld -R we can then refer to
# these symbols in the kernel code rather than hand-coded addresses.
-extra-y += vdso-syms.o
-$(obj)/built-in.o: $(obj)/vdso-syms.o
-$(obj)/built-in.o: ld_flags += -R $(obj)/vdso-syms.o
SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
$(call cc-ldoption, -Wl$(comma)--hash-style=both)
-SYSCFLAGS_vdso_syms.o = -r
-$(obj)/vdso-syms.o: $(src)/vdso.lds $(obj)/vrt_sigreturn.o FORCE
+SYSCFLAGS_vdso_dummy.o = -r
+$(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/vrt_sigreturn.o FORCE
$(call if_changed,vdsold)
+quiet_cmd_vdso_sym = VDSOSYM $@
+ cmd_vdso_sym = $(LD) -r -R $(obj)/vdso-dummy.o -o $@
+
+$(obj)/vdso-syms.o: $(obj)/vdso-dummy.o
+ $(call if_changed,vdso_sym)
# strip rule for the .so file
$(obj)/%.so: OBJCOPYFLAGS := -S
--
2.11.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/3] fix ia64, tile, sh for thin archives
2017-06-22 12:39 [PATCH v2 0/3] fix ia64, tile, sh for thin archives Nicholas Piggin
` (2 preceding siblings ...)
2017-06-22 12:39 ` [PATCH v2 3/3] tile: " Nicholas Piggin
@ 2017-06-23 3:23 ` Masahiro Yamada
2017-06-23 3:42 ` Nicholas Piggin
3 siblings, 1 reply; 15+ messages in thread
From: Masahiro Yamada @ 2017-06-23 3:23 UTC (permalink / raw)
To: Nicholas Piggin; +Cc: Linux Kbuild mailing list
2017-06-22 21:39 GMT+09:00 Nicholas Piggin <npiggin@gmail.com>:
> This is a re-work of the vdso symbol linking patches to avoid the
> problem,
>
> ld: warning: .note.gnu.build-id section discarded, --build-id ignored.
>
> I was able to reproduce the problem, and I have compiled
> defconfig for 3 architectures here with this new approach
> and I saw no problems.
>
> Please replace the existing patches in kbuild/thin-ac with these
> 3 if you agree with them.
I did so. Thanks!
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 1/3] sh: thin archives fix linking
2017-06-22 12:39 ` [PATCH v2 1/3] sh: thin archives fix linking Nicholas Piggin
@ 2017-06-23 3:25 ` Masahiro Yamada
2017-06-23 3:50 ` Nicholas Piggin
0 siblings, 1 reply; 15+ messages in thread
From: Masahiro Yamada @ 2017-06-23 3:25 UTC (permalink / raw)
To: Nicholas Piggin
Cc: Linux Kbuild mailing list, Yoshinori Sato, Rich Felker, linux-sh
2017-06-22 21:39 GMT+09:00 Nicholas Piggin <npiggin@gmail.com>:
> The VDSO symbols can't be linked into built-in.o when building with
> thin archives, so change this to linking a new object file that is
> included into the built-in.o.
>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Rich Felker <dalias@libc.org>
> Cc: linux-sh@vger.kernel.org
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> arch/sh/kernel/vsyscall/Makefile | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/arch/sh/kernel/vsyscall/Makefile b/arch/sh/kernel/vsyscall/Makefile
> index 8f0ea5fc835c..efc7a6837ef6 100644
> --- a/arch/sh/kernel/vsyscall/Makefile
> +++ b/arch/sh/kernel/vsyscall/Makefile
> @@ -1,4 +1,4 @@
> -obj-y += vsyscall.o vsyscall-syscall.o
> +obj-y += vsyscall.o vsyscall-syscall.o vsyscall-syms.o
>
> $(obj)/vsyscall-syscall.o: \
> $(foreach F,trapa,$(obj)/vsyscall-$F.so)
> @@ -26,11 +26,13 @@ $(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE
> # We also create a special relocatable object that should mirror the symbol
> # table and layout of the linked DSO. With ld -R we can then refer to
> # these symbols in the kernel code rather than hand-coded addresses.
> -extra-y += vsyscall-syms.o
> -$(obj)/built-in.o: $(obj)/vsyscall-syms.o
> -$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o
> -
> -SYSCFLAGS_vsyscall-syms.o = -r
> -$(obj)/vsyscall-syms.o: $(src)/vsyscall.lds \
> +SYSCFLAGS_vsyscall-dummy.o = -r
> +$(obj)/vsyscall-dummy.o: $(src)/vsyscall.lds \
> $(obj)/vsyscall-trapa.o $(obj)/vsyscall-note.o FORCE
> $(call if_changed,syscall)
> +
> +quiet_cmd_syscall_syms = SYSCALL $@
> + cmd_syscall_syms = $(LD) -r -R $(obj)/vsyscall-dummy.o -o $@
> +
> +$(obj)/vsyscall-syms.o: $(obj)/vsyscall-dummy.o
> + $(call if_changed,syscall_syms)
> --
> 2.11.0
I applied this, but
I just noticed vsyscall-dummy is rebuilt every time.
SYSCALL arch/sh/kernel/vsyscall/vsyscall-dummy.o
SYSCALL arch/sh/kernel/vsyscall/vsyscall-syms.o
AR arch/sh/kernel/vsyscall/built-in.o
AR arch/sh/kernel/built-in.o
We can avoid the unneeded rebuild by adding "vsyscall-dummy.o" to "targets".
targets += vsyscall-note.o vsyscall.lds vsyscall-dummy.o
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/3] fix ia64, tile, sh for thin archives
2017-06-23 3:23 ` [PATCH v2 0/3] fix ia64, tile, sh for thin archives Masahiro Yamada
@ 2017-06-23 3:42 ` Nicholas Piggin
0 siblings, 0 replies; 15+ messages in thread
From: Nicholas Piggin @ 2017-06-23 3:42 UTC (permalink / raw)
To: Masahiro Yamada; +Cc: Linux Kbuild mailing list
On Fri, 23 Jun 2017 12:23:48 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
> 2017-06-22 21:39 GMT+09:00 Nicholas Piggin <npiggin@gmail.com>:
> > This is a re-work of the vdso symbol linking patches to avoid the
> > problem,
> >
> > ld: warning: .note.gnu.build-id section discarded, --build-id ignored.
> >
> > I was able to reproduce the problem, and I have compiled
> > defconfig for 3 architectures here with this new approach
> > and I saw no problems.
> >
> > Please replace the existing patches in kbuild/thin-ac with these
> > 3 if you agree with them.
>
> I did so. Thanks!
>
>
>
Thank you Yamada san, will you merge David's patch for sparc64 as well?
Thanks,
Nick
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 1/3] sh: thin archives fix linking
2017-06-23 3:25 ` Masahiro Yamada
@ 2017-06-23 3:50 ` Nicholas Piggin
2017-06-23 10:02 ` Masahiro Yamada
0 siblings, 1 reply; 15+ messages in thread
From: Nicholas Piggin @ 2017-06-23 3:50 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Linux Kbuild mailing list, Yoshinori Sato, Rich Felker, linux-sh
On Fri, 23 Jun 2017 12:25:10 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
> 2017-06-22 21:39 GMT+09:00 Nicholas Piggin <npiggin@gmail.com>:
> > The VDSO symbols can't be linked into built-in.o when building with
> > thin archives, so change this to linking a new object file that is
> > included into the built-in.o.
> >
> > Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> > Cc: Rich Felker <dalias@libc.org>
> > Cc: linux-sh@vger.kernel.org
> > Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> > ---
> > arch/sh/kernel/vsyscall/Makefile | 16 +++++++++-------
> > 1 file changed, 9 insertions(+), 7 deletions(-)
> >
> > diff --git a/arch/sh/kernel/vsyscall/Makefile b/arch/sh/kernel/vsyscall/Makefile
> > index 8f0ea5fc835c..efc7a6837ef6 100644
> > --- a/arch/sh/kernel/vsyscall/Makefile
> > +++ b/arch/sh/kernel/vsyscall/Makefile
> > @@ -1,4 +1,4 @@
> > -obj-y += vsyscall.o vsyscall-syscall.o
> > +obj-y += vsyscall.o vsyscall-syscall.o vsyscall-syms.o
> >
> > $(obj)/vsyscall-syscall.o: \
> > $(foreach F,trapa,$(obj)/vsyscall-$F.so)
> > @@ -26,11 +26,13 @@ $(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE
> > # We also create a special relocatable object that should mirror the symbol
> > # table and layout of the linked DSO. With ld -R we can then refer to
> > # these symbols in the kernel code rather than hand-coded addresses.
> > -extra-y += vsyscall-syms.o
> > -$(obj)/built-in.o: $(obj)/vsyscall-syms.o
> > -$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o
> > -
> > -SYSCFLAGS_vsyscall-syms.o = -r
> > -$(obj)/vsyscall-syms.o: $(src)/vsyscall.lds \
> > +SYSCFLAGS_vsyscall-dummy.o = -r
> > +$(obj)/vsyscall-dummy.o: $(src)/vsyscall.lds \
> > $(obj)/vsyscall-trapa.o $(obj)/vsyscall-note.o FORCE
> > $(call if_changed,syscall)
> > +
> > +quiet_cmd_syscall_syms = SYSCALL $@
> > + cmd_syscall_syms = $(LD) -r -R $(obj)/vsyscall-dummy.o -o $@
> > +
> > +$(obj)/vsyscall-syms.o: $(obj)/vsyscall-dummy.o
> > + $(call if_changed,syscall_syms)
> > --
> > 2.11.0
>
> I applied this, but
> I just noticed vsyscall-dummy is rebuilt every time.
>
>
> SYSCALL arch/sh/kernel/vsyscall/vsyscall-dummy.o
> SYSCALL arch/sh/kernel/vsyscall/vsyscall-syms.o
> AR arch/sh/kernel/vsyscall/built-in.o
> AR arch/sh/kernel/built-in.o
>
>
>
> We can avoid the unneeded rebuild by adding "vsyscall-dummy.o" to "targets".
>
> targets += vsyscall-note.o vsyscall.lds vsyscall-dummy.o
Thanks, good catch. The tile patch may have the same issue?
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 2/3] ia64: thin archives fix linking
2017-06-22 12:39 ` [PATCH v2 2/3] ia64: " Nicholas Piggin
@ 2017-06-23 9:56 ` Masahiro Yamada
2017-06-23 13:44 ` Nicholas Piggin
0 siblings, 1 reply; 15+ messages in thread
From: Masahiro Yamada @ 2017-06-23 9:56 UTC (permalink / raw)
To: Nicholas Piggin
Cc: Linux Kbuild mailing list, Tony Luck, Fenghua Yu, linux-ia64
Hi Nicholas,
2017-06-22 21:39 GMT+09:00 Nicholas Piggin <npiggin@gmail.com>:
> The VDSO symbols can't be linked into built-in.o when building with
> thin archives, so change this to linking a new object file that is
> included into the built-in.o.
>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: linux-ia64@vger.kernel.org
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> arch/ia64/kernel/Makefile.gate | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/arch/ia64/kernel/Makefile.gate b/arch/ia64/kernel/Makefile.gate
> index a32903ada016..e20c711c2b1e 100644
> --- a/arch/ia64/kernel/Makefile.gate
> +++ b/arch/ia64/kernel/Makefile.gate
> @@ -2,7 +2,9 @@
>
> targets += gate.so gate-syms.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,12 +16,12 @@ 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 -T $(obj)/gate.lds -R $(obj)/gate.o -o $@
>
> -GATECFLAGS_gate-syms.o = -r
> $(obj)/gate-syms.o: $(obj)/gate.lds $(obj)/gate.o FORCE
> - $(call if_changed,gate)
> + $(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.
> --
> 2.11.0
Build test passed, but the symbol table seems different.
For example, __kernel_sigtramp will change
a000000000040740 T __kernel_sigtramp
to
0000000000000020 A __kernel_sigtramp
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?
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 1/3] sh: thin archives fix linking
2017-06-23 3:50 ` Nicholas Piggin
@ 2017-06-23 10:02 ` Masahiro Yamada
2017-06-25 3:24 ` Masahiro Yamada
0 siblings, 1 reply; 15+ messages in thread
From: Masahiro Yamada @ 2017-06-23 10:02 UTC (permalink / raw)
To: Nicholas Piggin
Cc: Linux Kbuild mailing list, Yoshinori Sato, Rich Felker, linux-sh
2017-06-23 12:50 GMT+09:00 Nicholas Piggin <npiggin@gmail.com>:
> On Fri, 23 Jun 2017 12:25:10 +0900
> Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>
>> 2017-06-22 21:39 GMT+09:00 Nicholas Piggin <npiggin@gmail.com>:
>> > The VDSO symbols can't be linked into built-in.o when building with
>> > thin archives, so change this to linking a new object file that is
>> > included into the built-in.o.
>> >
>> > Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
>> > Cc: Rich Felker <dalias@libc.org>
>> > Cc: linux-sh@vger.kernel.org
>> > Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>> > ---
>> > arch/sh/kernel/vsyscall/Makefile | 16 +++++++++-------
>> > 1 file changed, 9 insertions(+), 7 deletions(-)
>> >
>> > diff --git a/arch/sh/kernel/vsyscall/Makefile b/arch/sh/kernel/vsyscall/Makefile
>> > index 8f0ea5fc835c..efc7a6837ef6 100644
>> > --- a/arch/sh/kernel/vsyscall/Makefile
>> > +++ b/arch/sh/kernel/vsyscall/Makefile
>> > @@ -1,4 +1,4 @@
>> > -obj-y += vsyscall.o vsyscall-syscall.o
>> > +obj-y += vsyscall.o vsyscall-syscall.o vsyscall-syms.o
>> >
>> > $(obj)/vsyscall-syscall.o: \
>> > $(foreach F,trapa,$(obj)/vsyscall-$F.so)
>> > @@ -26,11 +26,13 @@ $(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE
>> > # We also create a special relocatable object that should mirror the symbol
>> > # table and layout of the linked DSO. With ld -R we can then refer to
>> > # these symbols in the kernel code rather than hand-coded addresses.
>> > -extra-y += vsyscall-syms.o
>> > -$(obj)/built-in.o: $(obj)/vsyscall-syms.o
>> > -$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o
>> > -
>> > -SYSCFLAGS_vsyscall-syms.o = -r
>> > -$(obj)/vsyscall-syms.o: $(src)/vsyscall.lds \
>> > +SYSCFLAGS_vsyscall-dummy.o = -r
>> > +$(obj)/vsyscall-dummy.o: $(src)/vsyscall.lds \
>> > $(obj)/vsyscall-trapa.o $(obj)/vsyscall-note.o FORCE
>> > $(call if_changed,syscall)
>> > +
>> > +quiet_cmd_syscall_syms = SYSCALL $@
>> > + cmd_syscall_syms = $(LD) -r -R $(obj)/vsyscall-dummy.o -o $@
>> > +
>> > +$(obj)/vsyscall-syms.o: $(obj)/vsyscall-dummy.o
>> > + $(call if_changed,syscall_syms)
>> > --
>> > 2.11.0
>>
>> I applied this, but
>> I just noticed vsyscall-dummy is rebuilt every time.
>>
>>
>> SYSCALL arch/sh/kernel/vsyscall/vsyscall-dummy.o
>> SYSCALL arch/sh/kernel/vsyscall/vsyscall-syms.o
>> AR arch/sh/kernel/vsyscall/built-in.o
>> AR arch/sh/kernel/built-in.o
>>
>>
>>
>> We can avoid the unneeded rebuild by adding "vsyscall-dummy.o" to "targets".
>>
>> targets += vsyscall-note.o vsyscall.lds vsyscall-dummy.o
>
> Thanks, good catch. The tile patch may have the same issue?
> --
I think so.
One more fix.
+$(obj)/vsyscall-syms.o: $(obj)/vsyscall-dummy.o
+ $(call if_changed,syscall_syms)
$(call if_changed,...) must have FORCE in the dependency field.
Otherwise, if_changed may not be evaluated.
I can fix up it locally. :-)
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 2/3] ia64: thin archives fix linking
2017-06-23 9:56 ` Masahiro Yamada
@ 2017-06-23 13:44 ` Nicholas Piggin
2017-06-25 3:26 ` Masahiro Yamada
0 siblings, 1 reply; 15+ messages in thread
From: Nicholas Piggin @ 2017-06-23 13:44 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Linux Kbuild mailing list, Tony Luck, Fenghua Yu, linux-ia64
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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v2 1/3] sh: thin archives fix linking
2017-06-23 10:02 ` Masahiro Yamada
@ 2017-06-25 3:24 ` Masahiro Yamada
0 siblings, 0 replies; 15+ messages in thread
From: Masahiro Yamada @ 2017-06-25 3:24 UTC (permalink / raw)
To: Nicholas Piggin
Cc: Linux Kbuild mailing list, Yoshinori Sato, Rich Felker, linux-sh
2017-06-23 19:02 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> 2017-06-23 12:50 GMT+09:00 Nicholas Piggin <npiggin@gmail.com>:
>> On Fri, 23 Jun 2017 12:25:10 +0900
>> Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>>
>>> 2017-06-22 21:39 GMT+09:00 Nicholas Piggin <npiggin@gmail.com>:
>>> > The VDSO symbols can't be linked into built-in.o when building with
>>> > thin archives, so change this to linking a new object file that is
>>> > included into the built-in.o.
>>> >
>>> > Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
>>> > Cc: Rich Felker <dalias@libc.org>
>>> > Cc: linux-sh@vger.kernel.org
>>> > Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>>> > ---
>>> > arch/sh/kernel/vsyscall/Makefile | 16 +++++++++-------
>>> > 1 file changed, 9 insertions(+), 7 deletions(-)
>>> >
>>> > diff --git a/arch/sh/kernel/vsyscall/Makefile b/arch/sh/kernel/vsyscall/Makefile
>>> > index 8f0ea5fc835c..efc7a6837ef6 100644
>>> > --- a/arch/sh/kernel/vsyscall/Makefile
>>> > +++ b/arch/sh/kernel/vsyscall/Makefile
>>> > @@ -1,4 +1,4 @@
>>> > -obj-y += vsyscall.o vsyscall-syscall.o
>>> > +obj-y += vsyscall.o vsyscall-syscall.o vsyscall-syms.o
>>> >
>>> > $(obj)/vsyscall-syscall.o: \
>>> > $(foreach F,trapa,$(obj)/vsyscall-$F.so)
>>> > @@ -26,11 +26,13 @@ $(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE
>>> > # We also create a special relocatable object that should mirror the symbol
>>> > # table and layout of the linked DSO. With ld -R we can then refer to
>>> > # these symbols in the kernel code rather than hand-coded addresses.
>>> > -extra-y += vsyscall-syms.o
>>> > -$(obj)/built-in.o: $(obj)/vsyscall-syms.o
>>> > -$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o
>>> > -
>>> > -SYSCFLAGS_vsyscall-syms.o = -r
>>> > -$(obj)/vsyscall-syms.o: $(src)/vsyscall.lds \
>>> > +SYSCFLAGS_vsyscall-dummy.o = -r
>>> > +$(obj)/vsyscall-dummy.o: $(src)/vsyscall.lds \
>>> > $(obj)/vsyscall-trapa.o $(obj)/vsyscall-note.o FORCE
>>> > $(call if_changed,syscall)
>>> > +
>>> > +quiet_cmd_syscall_syms = SYSCALL $@
>>> > + cmd_syscall_syms = $(LD) -r -R $(obj)/vsyscall-dummy.o -o $@
>>> > +
>>> > +$(obj)/vsyscall-syms.o: $(obj)/vsyscall-dummy.o
>>> > + $(call if_changed,syscall_syms)
>>> > --
>>> > 2.11.0
>>>
>>> I applied this, but
>>> I just noticed vsyscall-dummy is rebuilt every time.
>>>
>>>
>>> SYSCALL arch/sh/kernel/vsyscall/vsyscall-dummy.o
>>> SYSCALL arch/sh/kernel/vsyscall/vsyscall-syms.o
>>> AR arch/sh/kernel/vsyscall/built-in.o
>>> AR arch/sh/kernel/built-in.o
>>>
>>>
>>>
>>> We can avoid the unneeded rebuild by adding "vsyscall-dummy.o" to "targets".
>>>
>>> targets += vsyscall-note.o vsyscall.lds vsyscall-dummy.o
>>
>> Thanks, good catch. The tile patch may have the same issue?
>> --
>
> I think so.
>
>
> One more fix.
>
>
> +$(obj)/vsyscall-syms.o: $(obj)/vsyscall-dummy.o
> + $(call if_changed,syscall_syms)
>
>
> $(call if_changed,...) must have FORCE in the dependency field.
> Otherwise, if_changed may not be evaluated.
>
> I can fix up it locally. :-)
>
I updated thin-ar branch.
Just in case, the following is my local fix-up:
- Fix incremental build
- Do not repeat "$(obj)/vsyscall-dummy.o" in the build command
diff --git a/arch/sh/kernel/vsyscall/Makefile b/arch/sh/kernel/vsyscall/Makefile
index efc7a68..99685e5 100644
--- a/arch/sh/kernel/vsyscall/Makefile
+++ b/arch/sh/kernel/vsyscall/Makefile
@@ -5,7 +5,7 @@ $(obj)/vsyscall-syscall.o: \
# Teach kbuild about targets
targets += $(foreach F,trapa,vsyscall-$F.o vsyscall-$F.so)
-targets += vsyscall-note.o vsyscall.lds
+targets += vsyscall-note.o vsyscall.lds vsyscall-dummy.o
# The DSO images are built using a special linker script
quiet_cmd_syscall = SYSCALL $@
@@ -32,7 +32,7 @@ $(obj)/vsyscall-dummy.o: $(src)/vsyscall.lds \
$(call if_changed,syscall)
quiet_cmd_syscall_syms = SYSCALL $@
- cmd_syscall_syms = $(LD) -r -R $(obj)/vsyscall-dummy.o -o $@
+ cmd_syscall_syms = $(LD) -r -o $@ -R $<
-$(obj)/vsyscall-syms.o: $(obj)/vsyscall-dummy.o
+$(obj)/vsyscall-syms.o: $(obj)/vsyscall-dummy.o FORCE
$(call if_changed,syscall_syms)
--
Best Regards
Masahiro Yamada
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v2 2/3] ia64: thin archives fix linking
2017-06-23 13:44 ` Nicholas Piggin
@ 2017-06-25 3:26 ` Masahiro Yamada
0 siblings, 0 replies; 15+ messages in thread
From: Masahiro Yamada @ 2017-06-25 3:26 UTC (permalink / raw)
To: Nicholas Piggin
Cc: Linux Kbuild mailing list, Tony Luck, Fenghua Yu, linux-ia64
2017-06-23 22:44 GMT+09:00 Nicholas Piggin <npiggin@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
> --
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
--
Best Regards
Masahiro Yamada
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v2 3/3] tile: thin archives fix linking
2017-06-22 12:39 ` [PATCH v2 3/3] tile: " Nicholas Piggin
@ 2017-06-25 3:28 ` Masahiro Yamada
2017-06-25 5:23 ` Nicholas Piggin
0 siblings, 1 reply; 15+ messages in thread
From: Masahiro Yamada @ 2017-06-25 3:28 UTC (permalink / raw)
To: Nicholas Piggin; +Cc: Linux Kbuild mailing list, Chris Metcalf
2017-06-22 21:39 GMT+09:00 Nicholas Piggin <npiggin@gmail.com>:
> The VDSO symbols can't be linked into built-in.o when building with
> thin archives, so change this to linking a new object file that is
> included into the built-in.o.
>
> Cc: Chris Metcalf <cmetcalf@mellanox.com>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> arch/tile/kernel/vdso/Makefile | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/arch/tile/kernel/vdso/Makefile b/arch/tile/kernel/vdso/Makefile
> index c54fff37b5ff..e140472d5be6 100644
> --- a/arch/tile/kernel/vdso/Makefile
> +++ b/arch/tile/kernel/vdso/Makefile
> @@ -11,7 +11,7 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
> # vdso32 is only for tilegx -m32 compat task.
> VDSO32-$(CONFIG_COMPAT) := y
>
> -obj-y += vdso.o
> +obj-y += vdso.o vdso-syms.o
> obj-$(VDSO32-y) += vdso32.o
> extra-y += vdso.lds
> CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
> @@ -49,16 +49,18 @@ $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso)
> # We also create a special relocatable object that should mirror the symbol
> # table and layout of the linked DSO. With ld -R we can then refer to
> # these symbols in the kernel code rather than hand-coded addresses.
> -extra-y += vdso-syms.o
> -$(obj)/built-in.o: $(obj)/vdso-syms.o
> -$(obj)/built-in.o: ld_flags += -R $(obj)/vdso-syms.o
>
> SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
> $(call cc-ldoption, -Wl$(comma)--hash-style=both)
> -SYSCFLAGS_vdso_syms.o = -r
> -$(obj)/vdso-syms.o: $(src)/vdso.lds $(obj)/vrt_sigreturn.o FORCE
> +SYSCFLAGS_vdso_dummy.o = -r
> +$(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/vrt_sigreturn.o FORCE
> $(call if_changed,vdsold)
>
> +quiet_cmd_vdso_sym = VDSOSYM $@
> + cmd_vdso_sym = $(LD) -r -R $(obj)/vdso-dummy.o -o $@
> +
> +$(obj)/vdso-syms.o: $(obj)/vdso-dummy.o
> + $(call if_changed,vdso_sym)
>
> # strip rule for the .so file
> $(obj)/%.so: OBJCOPYFLAGS := -S
> --
> 2.11.0
>
> --
I updated thin-ar branch.
Just in case, the following is my local fix-up:
- Fix incremental build
- Do not repeat "$(obj)/vsyscall-dummy.o" in the build command
diff --git a/arch/tile/kernel/vdso/Makefile b/arch/tile/kernel/vdso/Makefile
index edb7809..c615ec0 100644
--- a/arch/tile/kernel/vdso/Makefile
+++ b/arch/tile/kernel/vdso/Makefile
@@ -5,7 +5,7 @@ vdso-syms = rt_sigreturn gettimeofday
obj-vdso = $(patsubst %, v%.o, $(vdso-syms))
# Build rules
-targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds
+targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds vdso-dummy.o
obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
# vdso32 is only for tilegx -m32 compat task.
@@ -56,9 +56,9 @@ $(obj)/vdso-dummy.o: $(src)/vdso.lds
$(obj)/vrt_sigreturn.o FORCE
$(call if_changed,vdsold)
quiet_cmd_vdso_sym = VDSOSYM $@
- cmd_vdso_sym = $(LD) -r -R $(obj)/vdso-dummy.o -o $@
+ cmd_vdso_sym = $(LD) -r -o $@ -R $<
-$(obj)/vdso-syms.o: $(obj)/vdso-dummy.o
+$(obj)/vdso-syms.o: $(obj)/vdso-dummy.o FORCE
$(call if_changed,vdso_sym)
# strip rule for the .so file
--
Best Regards
Masahiro Yamada
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v2 3/3] tile: thin archives fix linking
2017-06-25 3:28 ` Masahiro Yamada
@ 2017-06-25 5:23 ` Nicholas Piggin
0 siblings, 0 replies; 15+ messages in thread
From: Nicholas Piggin @ 2017-06-25 5:23 UTC (permalink / raw)
To: Masahiro Yamada; +Cc: Linux Kbuild mailing list, Chris Metcalf
On Sun, 25 Jun 2017 12:28:43 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
> 2017-06-22 21:39 GMT+09:00 Nicholas Piggin <npiggin@gmail.com>:
> > The VDSO symbols can't be linked into built-in.o when building with
> > thin archives, so change this to linking a new object file that is
> > included into the built-in.o.
> >
> > Cc: Chris Metcalf <cmetcalf@mellanox.com>
> > Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> > ---
> > arch/tile/kernel/vdso/Makefile | 14 ++++++++------
> > 1 file changed, 8 insertions(+), 6 deletions(-)
> >
> > diff --git a/arch/tile/kernel/vdso/Makefile b/arch/tile/kernel/vdso/Makefile
> > index c54fff37b5ff..e140472d5be6 100644
> > --- a/arch/tile/kernel/vdso/Makefile
> > +++ b/arch/tile/kernel/vdso/Makefile
> > @@ -11,7 +11,7 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
> > # vdso32 is only for tilegx -m32 compat task.
> > VDSO32-$(CONFIG_COMPAT) := y
> >
> > -obj-y += vdso.o
> > +obj-y += vdso.o vdso-syms.o
> > obj-$(VDSO32-y) += vdso32.o
> > extra-y += vdso.lds
> > CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
> > @@ -49,16 +49,18 @@ $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso)
> > # We also create a special relocatable object that should mirror the symbol
> > # table and layout of the linked DSO. With ld -R we can then refer to
> > # these symbols in the kernel code rather than hand-coded addresses.
> > -extra-y += vdso-syms.o
> > -$(obj)/built-in.o: $(obj)/vdso-syms.o
> > -$(obj)/built-in.o: ld_flags += -R $(obj)/vdso-syms.o
> >
> > SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
> > $(call cc-ldoption, -Wl$(comma)--hash-style=both)
> > -SYSCFLAGS_vdso_syms.o = -r
> > -$(obj)/vdso-syms.o: $(src)/vdso.lds $(obj)/vrt_sigreturn.o FORCE
> > +SYSCFLAGS_vdso_dummy.o = -r
> > +$(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/vrt_sigreturn.o FORCE
> > $(call if_changed,vdsold)
> >
> > +quiet_cmd_vdso_sym = VDSOSYM $@
> > + cmd_vdso_sym = $(LD) -r -R $(obj)/vdso-dummy.o -o $@
> > +
> > +$(obj)/vdso-syms.o: $(obj)/vdso-dummy.o
> > + $(call if_changed,vdso_sym)
> >
> > # strip rule for the .so file
> > $(obj)/%.so: OBJCOPYFLAGS := -S
> > --
> > 2.11.0
> >
> > --
>
> I updated thin-ar branch.
>
> Just in case, the following is my local fix-up:
>
> - Fix incremental build
> - Do not repeat "$(obj)/vsyscall-dummy.o" in the build command
All your changes here and to the other patches look good to me,
thanks for the help.
Thanks,
Nick
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2017-06-25 5:23 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-22 12:39 [PATCH v2 0/3] fix ia64, tile, sh for thin archives Nicholas Piggin
2017-06-22 12:39 ` [PATCH v2 1/3] sh: thin archives fix linking Nicholas Piggin
2017-06-23 3:25 ` Masahiro Yamada
2017-06-23 3:50 ` Nicholas Piggin
2017-06-23 10:02 ` Masahiro Yamada
2017-06-25 3:24 ` Masahiro Yamada
2017-06-22 12:39 ` [PATCH v2 2/3] ia64: " Nicholas Piggin
2017-06-23 9:56 ` Masahiro Yamada
2017-06-23 13:44 ` Nicholas Piggin
2017-06-25 3:26 ` Masahiro Yamada
2017-06-22 12:39 ` [PATCH v2 3/3] tile: " Nicholas Piggin
2017-06-25 3:28 ` Masahiro Yamada
2017-06-25 5:23 ` Nicholas Piggin
2017-06-23 3:23 ` [PATCH v2 0/3] fix ia64, tile, sh for thin archives Masahiro Yamada
2017-06-23 3:42 ` Nicholas Piggin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox