diff --git a/arch/x86/entry/Makefile b/arch/x86/entry/Makefile
index c97532492ef57..9df72c8a0ac24 100644
--- a/arch/x86/entry/Makefile
+++ b/arch/x86/entry/Makefile
@@ -1,8 +1,7 @@
 #
 # Makefile for the x86 low level entry code
 #
-obj-y				:= entry_$(BITS).o
-
+obj-y				:= entry_$(BITS).o thunk_$(BITS).o
 obj-y				+= vdso/
 
 obj-$(CONFIG_IA32_EMULATION)	+= ia32entry.o
diff --git a/arch/x86/lib/thunk_32.S b/arch/x86/entry/thunk_32.S
similarity index 100%
rename from arch/x86/lib/thunk_32.S
rename to arch/x86/entry/thunk_32.S
diff --git a/arch/x86/lib/thunk_64.S b/arch/x86/entry/thunk_64.S
similarity index 100%
rename from arch/x86/lib/thunk_64.S
rename to arch/x86/entry/thunk_64.S
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 982989d282ff5..f2587888d987f 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -17,7 +17,6 @@ clean-files := inat-tables.c
 obj-$(CONFIG_SMP) += msr-smp.o cache-smp.o
 
 lib-y := delay.o misc.o cmdline.o
-lib-y += thunk_$(BITS).o
 lib-y += usercopy_$(BITS).o usercopy.o getuser.o putuser.o
 lib-y += memcpy_$(BITS).o
 lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
diff --git a/arch/x86/um/Makefile b/arch/x86/um/Makefile
index acb384d246694..a8fecc226946d 100644
--- a/arch/x86/um/Makefile
+++ b/arch/x86/um/Makefile
@@ -26,7 +26,7 @@ else
 
 obj-y += syscalls_64.o vdso/
 
-subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o ../lib/thunk_64.o \
+subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o ../entry/thunk_64.o \
 		../lib/rwsem.o
 
 endif