diff mbox

[3/5] sh: thin archives fix linking

Message ID 20170609052417.561-4-npiggin@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Nicholas Piggin June 9, 2017, 5:24 a.m. UTC
The VDSO symbols can't be linked into built-in.o when building with
thin archives, so change this to linking them into the final link.

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 maintainers please give an ack if we can take this through
the kbuild tree.

Thanks,
Nick

 arch/sh/Makefile                 | 2 ++
 arch/sh/kernel/vsyscall/Makefile | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Masahiro Yamada June 19, 2017, 6:19 a.m. UTC | #1
2017-06-09 14:24 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 them into the final link.
>
> 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>
> ---

SH maintainers, any comments for this patch?


I confirmed this patch solved the build error,
but I do not have access to any SH hardware.

Some Acked-by will be very helpful.
diff mbox

Patch

diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 280bbff12102..a907366f0352 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -97,6 +97,8 @@  defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE)	:= vmlinux
 boot := arch/sh/boot
 KBUILD_IMAGE		:= $(boot)/$(defaultimage-y)
 
+LDFLAGS_vmlinux		+= -R arch/sh/kernel/vsyscall/vsyscall-syms.o
+
 #
 # Choosing incompatible machines durings configuration will result in
 # error messages during linking.
diff --git a/arch/sh/kernel/vsyscall/Makefile b/arch/sh/kernel/vsyscall/Makefile
index 8f0ea5fc835c..b82d13eb8d30 100644
--- a/arch/sh/kernel/vsyscall/Makefile
+++ b/arch/sh/kernel/vsyscall/Makefile
@@ -27,8 +27,6 @@  $(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE
 # 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 \