Index: binutils-gdb/gdb/gdbserver/Makefile.in
===================================================================
--- binutils-gdb.orig/gdb/gdbserver/Makefile.in
+++ binutils-gdb/gdb/gdbserver/Makefile.in
@@ -198,11 +198,11 @@ SFILES = \
 	$(srcdir)/win32-low.c \
 	$(srcdir)/wincecompat.c \
 	$(srcdir)/x86-low.c \
-	$(srcdir)/arch/arm.c \
-	$(srcdir)/arch/arm-get-next-pcs.c \
-	$(srcdir)/arch/arm-linux.c \
-	$(srcdir)/arch/ppc-linux-common.c \
 	$(srcdir)/../alloc.c \
+	$(srcdir)/../arch/arm.c \
+	$(srcdir)/../arch/arm-get-next-pcs.c \
+	$(srcdir)/../arch/arm-linux.c \
+	$(srcdir)/../arch/ppc-linux-common.c \
 	$(srcdir)/../../gdbsupport/btrace-common.c \
 	$(srcdir)/../../gdbsupport/buffer.c \
 	$(srcdir)/../../gdbsupport/cleanups.c \
@@ -229,15 +229,15 @@ SFILES = \
 	$(srcdir)/../../gdbsupport/safe-strerror.c \
 	$(srcdir)/../../gdbsupport/tdesc.c \
 	$(srcdir)/../../gdbsupport/xml-utils.c \
-	$(srcdir)/nat/aarch64-sve-linux-ptrace.c \
-	$(srcdir)/nat/linux-btrace.c \
-	$(srcdir)/nat/linux-namespaces.c \
-	$(srcdir)/nat/linux-osdata.c \
-	$(srcdir)/nat/linux-personality.c \
-	$(srcdir)/nat/mips-linux-watch.c \
-	$(srcdir)/nat/ppc-linux.c \
-	$(srcdir)/nat/fork-inferior.c \
-	$(srcdir)/target/waitstatus.c
+	$(srcdir)/../nat/aarch64-sve-linux-ptrace.c \
+	$(srcdir)/../nat/linux-btrace.c \
+	$(srcdir)/../nat/linux-namespaces.c \
+	$(srcdir)/../nat/linux-osdata.c \
+	$(srcdir)/../nat/linux-personality.c \
+	$(srcdir)/../nat/mips-linux-watch.c \
+	$(srcdir)/../nat/ppc-linux.c \
+	$(srcdir)/../nat/fork-inferior.c \
+	$(srcdir)/../target/waitstatus.c
 
 DEPFILES = @GDBSERVER_DEPFILES@
 
@@ -295,7 +295,7 @@ OBS = \
 	tracepoint.o \
 	utils.o \
 	version.o \
-	waitstatus.o \
+	target/waitstatus.o \
 	$(DEPFILES) \
 	$(LIBOBJS) \
 	$(XML_BUILTIN)
@@ -459,7 +459,9 @@ TAGS:	${TAGFILES}
 	etags \
 	  `for i in yzzy ${DEPFILES}; do \
 	     if [ x$$i != xyzzy ]; then \
-	       echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \
+	       echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' \
+		 -e 's,/\(arch\|nat\|target\)/,/../\1/,' \
+		 -e 's,/\(gdbsupport\)/,/../../\1/,'; \
 	     fi; \
 	   done` \
 	  ${TAGFILES}
@@ -633,11 +635,11 @@ gdbsupport/%.o: ../../gdbsupport/%.c
 	$(COMPILE) $<
 	$(POSTCOMPILE)
 
-%.o: ../nat/%.c
+nat/%.o: ../nat/%.c
 	$(COMPILE) $<
 	$(POSTCOMPILE)
 
-%.o: ../target/%.c
+target/%.o: ../target/%.c
 	$(COMPILE) $<
 	$(POSTCOMPILE)
 
Index: binutils-gdb/gdb/gdbserver/configure
===================================================================
--- binutils-gdb.orig/gdb/gdbserver/configure
+++ binutils-gdb/gdb/gdbserver/configure
@@ -6025,7 +6025,7 @@ ac_config_commands="$ac_config_commands
 
 
 # Create sub-directories for objects and dependencies.
-CONFIG_SRC_SUBDIR="arch gdbsupport"
+CONFIG_SRC_SUBDIR="arch gdbsupport nat target"
 
 
 ac_config_commands="$ac_config_commands gdbdepdir"
Index: binutils-gdb/gdb/gdbserver/configure.ac
===================================================================
--- binutils-gdb.orig/gdb/gdbserver/configure.ac
+++ binutils-gdb/gdb/gdbserver/configure.ac
@@ -56,7 +56,7 @@ ACX_NONCANONICAL_HOST
 ZW_CREATE_DEPDIR
 
 # Create sub-directories for objects and dependencies.
-CONFIG_SRC_SUBDIR="arch gdbsupport"
+CONFIG_SRC_SUBDIR="arch gdbsupport nat target"
 AC_SUBST(CONFIG_SRC_SUBDIR)
 
 AC_CONFIG_COMMANDS([gdbdepdir],[
Index: binutils-gdb/gdb/gdbserver/configure.srv
===================================================================
--- binutils-gdb.orig/gdb/gdbserver/configure.srv
+++ binutils-gdb/gdb/gdbserver/configure.srv
@@ -28,21 +28,22 @@ ipa_ppc_linux_regobj="powerpc-32l-ipa.o
 
 # Linux object files.  This is so we don't have to repeat
 # these files over and over again.
-srv_linux_obj="linux-low.o linux-osdata.o linux-procfs.o linux-ptrace.o linux-waitpid.o linux-personality.o linux-namespaces.o fork-child.o fork-inferior.o"
+srv_linux_obj="linux-low.o nat/linux-osdata.o nat/linux-procfs.o nat/linux-ptrace.o nat/linux-waitpid.o nat/linux-personality.o nat/linux-namespaces.o fork-child.o nat/fork-inferior.o"
 
 # Input is taken from the "${target}" variable.
 
 case "${target}" in
-  aarch64*-*-linux*)	srv_tgtobj="linux-aarch64-low.o aarch64-linux-hw-point.o"
+  aarch64*-*-linux*)	srv_tgtobj="linux-aarch64-low.o"
+			srv_tgtobj="$srv_tgtobj nat/aarch64-linux-hw-point.o"
 			srv_tgtobj="$srv_tgtobj linux-aarch32-low.o"
 			srv_tgtobj="$srv_tgtobj linux-aarch32-tdesc.o"
 			srv_tgtobj="${srv_tgtobj} arch/aarch32.o"
 			srv_tgtobj="${srv_tgtobj} arch/arm.o"
-			srv_tgtobj="$srv_tgtobj aarch64-linux.o"
+			srv_tgtobj="$srv_tgtobj nat/aarch64-linux.o"
 			srv_tgtobj="$srv_tgtobj arch/aarch64-insn.o"
 			srv_tgtobj="$srv_tgtobj arch/aarch64.o"
 			srv_tgtobj="$srv_tgtobj linux-aarch64-tdesc.o"
-			srv_tgtobj="$srv_tgtobj aarch64-sve-linux-ptrace.o"
+			srv_tgtobj="$srv_tgtobj nat/aarch64-sve-linux-ptrace.o"
 			srv_tgtobj="${srv_tgtobj} $srv_linux_obj"
 			srv_linux_regsets=yes
 			srv_linux_thread_db=yes
@@ -86,14 +87,18 @@ case "${target}" in
 			srv_linux_thread_db=yes
 			;;
   i[34567]86-*-cygwin*)	srv_regobj=""
-			srv_tgtobj="x86-low.o x86-dregs.o win32-low.o win32-i386-low.o"
+			srv_tgtobj="x86-low.o nat/x86-dregs.o win32-low.o"
+			srv_tgtobj="${srv_tgtobj} win32-i386-low.o"
 			srv_tgtobj="${srv_tgtobj} arch/i386.o"
 			;;
   i[34567]86-*-linux*)	srv_tgtobj="${srv_tgtobj} arch/i386.o"
-			srv_tgtobj="${srv_tgtobj} $srv_linux_obj linux-x86-low.o x86-low.o x86-dregs.o i387-fp.o"
+			srv_tgtobj="${srv_tgtobj} $srv_linux_obj"
+			srv_tgtobj="${srv_tgtobj} linux-x86-low.o x86-low.o"
+			srv_tgtobj="${srv_tgtobj} nat/x86-dregs.o i387-fp.o"
 			srv_tgtobj="${srv_tgtobj} linux-x86-tdesc.o"
-			srv_tgtobj="${srv_tgtobj} linux-btrace.o x86-linux.o"
-			srv_tgtobj="${srv_tgtobj} x86-linux-dregs.o"
+			srv_tgtobj="${srv_tgtobj} nat/linux-btrace.o"
+			srv_tgtobj="${srv_tgtobj} nat/x86-linux.o"
+			srv_tgtobj="${srv_tgtobj} nat/x86-linux-dregs.o"
 			srv_linux_usrregs=yes
 			srv_linux_regsets=yes
 			srv_linux_thread_db=yes
@@ -102,13 +107,15 @@ case "${target}" in
 			ipa_obj="${ipa_obj} arch/i386-ipa.o"
 			;;
   i[34567]86-*-lynxos*)	srv_regobj=""
-			srv_tgtobj="lynx-low.o lynx-i386-low.o fork-child.o fork-inferior.o"
+			srv_tgtobj="lynx-low.o lynx-i386-low.o fork-child.o"
+			srv_tgtobj="${srv_tgtobj} nat/fork-inferior.o"
 			srv_tgtobj="${srv_tgtobj} arch/i386.o"
 			srv_lynxos=yes
 			;;
   i[34567]86-*-mingw32ce*)
 			srv_regobj=""
-			srv_tgtobj="x86-low.o x86-dregs.o win32-low.o win32-i386-low.o"
+			srv_tgtobj="x86-low.o nat/x86-dregs.o win32-low.o"
+			srv_tgtobj="${srv_tgtobj} win32-i386-low.o"
 			srv_tgtobj="${srv_tgtobj} arch/i386.o"
 			srv_tgtobj="${srv_tgtobj} wincecompat.o"
 			# hostio_last_error implementation is in win32-low.c
@@ -117,7 +124,7 @@ case "${target}" in
 			srv_mingwce=yes
 			;;
   i[34567]86-*-mingw*)	srv_regobj=""
-			srv_tgtobj="x86-low.o x86-dregs.o win32-low.o win32-i386-low.o"
+			srv_tgtobj="x86-low.o nat/x86-dregs.o win32-low.o"				srv_tgtobj="${srv_tgtobj} win32-i386-low.o"
 			srv_tgtobj="${srv_tgtobj} arch/i386.o"
 			srv_mingw=yes
 			;;
@@ -159,7 +166,7 @@ case "${target}" in
 			srv_regobj="${srv_regobj} mips64-linux.o"
 			srv_regobj="${srv_regobj} mips64-dsp-linux.o"
 			srv_tgtobj="$srv_linux_obj linux-mips-low.o"
-			srv_tgtobj="${srv_tgtobj} mips-linux-watch.o"
+			srv_tgtobj="${srv_tgtobj} nat/mips-linux-watch.o"
 			srv_xmlfiles="mips-linux.xml"
 			srv_xmlfiles="${srv_xmlfiles} mips-dsp-linux.xml"
 			srv_xmlfiles="${srv_xmlfiles} mips-cpu.xml"
@@ -203,7 +210,8 @@ case "${target}" in
 			srv_regobj="${srv_regobj} powerpc-isa205-ppr-dscr-vsx64l.o"
 			srv_regobj="${srv_regobj} powerpc-isa207-vsx64l.o"
 			srv_regobj="${srv_regobj} powerpc-isa207-htm-vsx64l.o"
-			srv_tgtobj="$srv_linux_obj linux-ppc-low.o ppc-linux.o"
+			srv_tgtobj="$srv_linux_obj linux-ppc-low.o"
+			srv_tgtobj="$srv_linux_obj nat/ppc-linux.o"
 			srv_tgtobj="${srv_tgtobj} arch/ppc-linux-common.o"
 			srv_xmlfiles="rs6000/powerpc-32l.xml"
 			srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-altivec32l.xml"
@@ -350,12 +358,13 @@ case "${target}" in
 			srv_linux_thread_db=yes
 			;;
   x86_64-*-linux*)	srv_tgtobj="$srv_linux_obj linux-x86-low.o x86-low.o"
-			srv_tgtobj="${srv_tgtobj} x86-dregs.o i387-fp.o"
+			srv_tgtobj="${srv_tgtobj} nat/x86-dregs.o i387-fp.o"
 			srv_tgtobj="${srv_tgtobj} arch/i386.o arch/amd64.o"
 			srv_tgtobj="${srv_tgtobj} linux-x86-tdesc.o"
-			srv_tgtobj="${srv_tgtobj} linux-btrace.o x86-linux.o"
-			srv_tgtobj="${srv_tgtobj} x86-linux-dregs.o"
-			srv_tgtobj="${srv_tgtobj} amd64-linux-siginfo.o"
+			srv_tgtobj="${srv_tgtobj} nat/linux-btrace.o"
+			srv_tgtobj="${srv_tgtobj} nat/x86-linux.o"
+			srv_tgtobj="${srv_tgtobj} nat/x86-linux-dregs.o"
+			srv_tgtobj="${srv_tgtobj} nat/amd64-linux-siginfo.o"
 			srv_linux_usrregs=yes # This is for i386 progs.
 			srv_linux_regsets=yes
 			srv_linux_thread_db=yes
@@ -364,12 +373,14 @@ case "${target}" in
 			ipa_obj="${ipa_obj} arch/amd64-ipa.o"
 			;;
   x86_64-*-mingw*)	srv_regobj=""
-			srv_tgtobj="x86-low.o x86-dregs.o i387-fp.o win32-low.o win32-i386-low.o"
+			srv_tgtobj="x86-low.o nat/x86-dregs.o i387-fp.o"
+			srv_tgtobj="${srv_tgtobj} win32-low.o win32-i386-low.o"
 			srv_tgtobj="${srv_tgtobj} arch/amd64.o"
 			srv_mingw=yes
 			;;
   x86_64-*-cygwin*)	srv_regobj=""
-			srv_tgtobj="x86-low.o x86-dregs.o i387-fp.o win32-low.o win32-i386-low.o"
+			srv_tgtobj="x86-low.o nat/x86-dregs.o i387-fp.o"
+			srv_tgtobj="${srv_tgtobj} win32-low.o win32-i386-low.o"
 			srv_tgtobj="${srv_tgtobj} arch/amd64.o"
 			;;
 
