Index: /trunk/kBuild/tools/GCC.kmk
===================================================================
--- /trunk/kBuild/tools/GCC.kmk	(revision 2540)
+++ /trunk/kBuild/tools/GCC.kmk	(revision 2541)
@@ -206,4 +206,7 @@
 	$(QUIET)$(TOOL_GCC_LD) $(flags) -o $(out) $(objs) \
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
+if1of ($(ld_debug), split)
+ $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GCC.)
+endif
 endef
 
@@ -228,4 +231,7 @@
 	$(QUIET)$(TOOL_GCC_LD) $(TOOL_GCC_LDFLAGS.dll) $(flags) -o $(out) $(objs) \
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
-endef
-
+if1of ($(ld_debug), split)
+ $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GCC.)
+endif
+endef
+
Index: /trunk/kBuild/tools/GCC3.kmk
===================================================================
--- /trunk/kBuild/tools/GCC3.kmk	(revision 2540)
+++ /trunk/kBuild/tools/GCC3.kmk	(revision 2541)
@@ -64,4 +64,10 @@
  TOOL_GCC3_LD_SYSMOD_MAP ?=
 endif
+if1of ($(KBUILD_HOST), solaris)
+ TOOL_GCC3_OBJCOPY ?= gobjcopy$(HOSTSUFF_EXE)
+else
+ TOOL_GCC3_OBJCOPY ?= objcopy$(HOSTSUFF_EXE)
+endif
+
 ifdef SLKRUNS
  TOOL_GCC3_CC  += -fmessage-length=0
@@ -257,4 +263,6 @@
 TOOL_GCC3_LINK_PROGRAM_OUTPUT =
 TOOL_GCC3_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map
+TOOL_GCC3_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).debug
+TOOL_GCC3_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
 TOOL_GCC3_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
 		$(filter %.def, $(othersrc))
@@ -266,4 +274,9 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
 		$(call TOOL_GCC3_LD_MAP,$(outbase).map)
+ ifeq ($(ld_debug),split)
+	$(TOOL_GCC3_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
+	$(CHMOD) a-x $(outbase).debug
+	$(TOOL_GCC3_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
+ endif
 endef
 
@@ -284,4 +297,6 @@
 TOOL_GCC3_LINK_DLL_OUTPUT =
 TOOL_GCC3_LINK_DLL_OUTPUT_MAYBE = $(outbase).map
+TOOL_GCC3_LINK_DLL_OUTPUT_DEBUG = $(outbase).debug
+TOOL_GCC3_LINK_DLL_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
 TOOL_GCC3_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
 		$(filter %.def, $(othersrc))
@@ -289,5 +304,5 @@
 define TOOL_GCC3_LINK_DLL_CMDS
 	$(QUIET)$(TOOL_GCC3_LD) $(TOOL_GCC3_LDFLAGS.dll) $(flags) -o $(out)\
-		$(if $(filter-out win32 os2, $(KBUILD_TARGET)),$(call TOOL_GCC3_LD_SONAME,$(target),$(out)))\
+		$(if $(filter-out win os2, $(KBUILD_TARGET)),$(call TOOL_GCC3_LD_SONAME,$(target),$(out)))\
 		$(objs)\
 		$(filter %.def, $(othersrc))\
@@ -295,4 +310,9 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
 		$(call TOOL_GCC3_LD_MAP,$(outbase).map)
+ ifeq ($(ld_debug),split)
+	$(TOOL_GCC3_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
+	$(CHMOD) a-x $(outbase).debug
+	$(TOOL_GCC3_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
+ endif
 endef
 
@@ -313,4 +333,6 @@
 TOOL_GCC3_LINK_SYSMOD_OUTPUT =
 TOOL_GCC3_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
+TOOL_GCC3_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).debug
+TOOL_GCC3_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
 TOOL_GCC3_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
 		$(filter %.def, $(othersrc))
@@ -322,4 +344,9 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
 		$(call TOOL_GCC3_LD_SYSMOD_MAP,$(outbase).map)
-endef
-
+ ifeq ($(ld_debug),split)
+	$(TOOL_GCC3_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
+	$(CHMOD) a-x $(outbase).debug
+	$(TOOL_GCC3_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
+ endif
+endef
+
Index: /trunk/kBuild/tools/GCC32.kmk
===================================================================
--- /trunk/kBuild/tools/GCC32.kmk	(revision 2540)
+++ /trunk/kBuild/tools/GCC32.kmk	(revision 2541)
@@ -59,7 +59,13 @@
 TOOL_GCC32_LD_SYSMOD_MAP ?=
 endif
+if1of ($(KBUILD_HOST), solaris)
+ TOOL_GCC32_OBJCOPY ?= gobjcopy$(HOSTSUFF_EXE)
+else
+ TOOL_GCC32_OBJCOPY ?= objcopy$(HOSTSUFF_EXE)
+endif
+
 ifdef SLKRUNS
-TOOL_GCC32_CC  += -fmessage-length=0
-TOOL_GCC32_CXX += -fmessage-length=0
+ TOOL_GCC32_CC  += -fmessage-length=0
+ TOOL_GCC32_CXX += -fmessage-length=0
 endif
 
@@ -227,5 +233,8 @@
 	$(QUIET)$(APPEND) -n $(out).ar-script \
 		$(foreach o,$(objs), 'ADDMOD $(o)') \
-		$(foreach o,$(othersrc), 'ADDLIB $(o)')
+		$(foreach o,$(filter-out %.def %.imp,$(othersrc)), 'ADDLIB $(o)')
+	$(if $(filter %.def %.imp,$(othersrc))\
+		,$(TOOL_GCC32_AR_IMP) -o $(outbase).imp.a $(filter %.def %.imp,$(othersrc))\
+		 $(NL)$(TAB)$(QUIET)$(APPEND) $(out).ar-script 'ADDLIB $(outbase).imp.a')
 	$(QUIET)$(APPEND) $(out).ar-script 'SAVE'
 	$(QUIET)$(APPEND) $(out).ar-script 'END'
@@ -249,5 +258,8 @@
 TOOL_GCC32_LINK_PROGRAM_OUTPUT =
 TOOL_GCC32_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map
-TOOL_GCC32_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
+TOOL_GCC32_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).debug
+TOOL_GCC32_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
+TOOL_GCC32_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
+		$(filter %.def, $(othersrc))
 TOOL_GCC32_LINK_PROGRAM_DEPORD =
 define TOOL_GCC32_LINK_PROGRAM_CMDS
@@ -256,4 +268,9 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
 		$(call TOOL_GCC32_LD_MAP,$(outbase).map)
+ ifeq ($(ld_debug),split)
+	$(TOOL_GCC32_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
+	$(CHMOD) a-x $(outbase).debug
+	$(TOOL_GCC32_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
+ endif
 endef
 
@@ -274,5 +291,8 @@
 TOOL_GCC32_LINK_DLL_OUTPUT =
 TOOL_GCC32_LINK_DLL_OUTPUT_MAYBE = $(outbase).map
-TOOL_GCC32_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
+TOOL_GCC32_LINK_DLL_OUTPUT_DEBUG = $(outbase).debug
+TOOL_GCC32_LINK_DLL_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
+TOOL_GCC32_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
+		$(filter %.def, $(othersrc))
 TOOL_GCC32_LINK_DLL_DEPORD =
 define TOOL_GCC32_LINK_DLL_CMDS
@@ -283,4 +303,9 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
 		$(call TOOL_GCC32_LD_MAP,$(outbase).map)
+ ifeq ($(ld_debug),split)
+	$(TOOL_GCC32_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
+	$(CHMOD) a-x $(outbase).debug
+	$(TOOL_GCC32_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
+ endif
 endef
 
@@ -301,11 +326,20 @@
 TOOL_GCC32_LINK_SYSMOD_OUTPUT =
 TOOL_GCC32_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
-TOOL_GCC32_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
+TOOL_GCC32_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).debug
+TOOL_GCC32_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
+TOOL_GCC32_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
+		$(filter %.def, $(othersrc))
 TOOL_GCC32_LINK_SYSMOD_DEPORD =
 define TOOL_GCC32_LINK_SYSMOD_CMDS
 	$(QUIET)$(TOOL_GCC32_LD_SYSMOD) $(TOOL_GCC32_LDFLAGS.sysmod) $(flags) -o $(out) $(objs)\
+		$(filter %.def, $(othersrc))\
 		$(foreach p,$(libpath), -L$(p))\
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
 		$(call TOOL_GCC32_LD_SYSMOD_MAP,$(outbase).map)
-endef
-
+ ifeq ($(ld_debug),split)
+	$(TOOL_GCC32_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
+	$(CHMOD) a-x $(outbase).debug
+	$(TOOL_GCC32_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
+ endif
+endef
+
Index: /trunk/kBuild/tools/GCC3PLAIN.kmk
===================================================================
--- /trunk/kBuild/tools/GCC3PLAIN.kmk	(revision 2540)
+++ /trunk/kBuild/tools/GCC3PLAIN.kmk	(revision 2541)
@@ -259,5 +259,5 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
 if1of ($(ld_debug), split)
- $(warning kBuild: Debug splitting is requrested for $(target), but this feature is not supported by GCC3PLAIN.)
+ $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GCC3PLAIN.)
 endif
 endef
@@ -290,5 +290,5 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
 if1of ($(ld_debug), split)
- $(warning kBuild: Debug splitting is requrested for $(target), but this feature is not supported by GCC3PLAIN.)
+ $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GCC3PLAIN.)
 endif
 endef
@@ -324,6 +324,6 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
 if1of ($(ld_debug), split)
- $(warning kBuild: Debug splitting is requrested for $(target), but this feature is not supported by GCC3PLAIN.)
-endif
-endef
-
+ $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GCC3PLAIN.)
+endif
+endef
+
Index: /trunk/kBuild/tools/GCC64.kmk
===================================================================
--- /trunk/kBuild/tools/GCC64.kmk	(revision 2540)
+++ /trunk/kBuild/tools/GCC64.kmk	(revision 2541)
@@ -59,7 +59,13 @@
 TOOL_GCC64_LD_SYSMOD_MAP ?=
 endif
+if1of ($(KBUILD_HOST), solaris)
+ TOOL_GCC64_OBJCOPY ?= gobjcopy$(HOSTSUFF_EXE)
+else
+ TOOL_GCC64_OBJCOPY ?= objcopy$(HOSTSUFF_EXE)
+endif
+
 ifdef SLKRUNS
-TOOL_GCC64_CC  += -fmessage-length=0
-TOOL_GCC64_CXX += -fmessage-length=0
+ TOOL_GCC64_CC  += -fmessage-length=0
+ TOOL_GCC64_CXX += -fmessage-length=0
 endif
 
@@ -172,5 +178,4 @@
 endef
 else # !KBUILD_USE_KOBJCACHE
-
 TOOL_GCC64_COMPILE_CXX_OUTPUT =
 define TOOL_GCC64_COMPILE_CXX_CMDS
@@ -249,4 +254,6 @@
 TOOL_GCC64_LINK_PROGRAM_OUTPUT =
 TOOL_GCC64_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map
+TOOL_GCC64_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).debug
+TOOL_GCC64_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
 TOOL_GCC64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
 TOOL_GCC64_LINK_PROGRAM_DEPORD =
@@ -256,4 +263,9 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
 		$(call TOOL_GCC64_LD_MAP,$(outbase).map)
+ ifeq ($(ld_debug),split)
+	$(TOOL_GCC64_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
+	$(CHMOD) a-x $(outbase).debug
+	$(TOOL_GCC64_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
+ endif
 endef
 
@@ -274,4 +286,6 @@
 TOOL_GCC64_LINK_DLL_OUTPUT =
 TOOL_GCC64_LINK_DLL_OUTPUT_MAYBE = $(outbase).map
+TOOL_GCC64_LINK_DLL_OUTPUT_DEBUG = $(outbase).debug
+TOOL_GCC64_LINK_DLL_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
 TOOL_GCC64_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
 TOOL_GCC64_LINK_DLL_DEPORD =
@@ -283,4 +297,9 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
 		$(call TOOL_GCC64_LD_MAP,$(outbase).map)
+ ifeq ($(ld_debug),split)
+	$(TOOL_GCC64_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
+	$(CHMOD) a-x $(outbase).debug
+	$(TOOL_GCC64_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
+ endif
 endef
 
@@ -301,4 +320,6 @@
 TOOL_GCC64_LINK_SYSMOD_OUTPUT =
 TOOL_GCC64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
+TOOL_GCC64_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).debug
+TOOL_GCC64_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
 TOOL_GCC64_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
 TOOL_GCC64_LINK_SYSMOD_DEPORD =
@@ -308,4 +329,9 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
 		$(call TOOL_GCC64_LD_SYSMOD_MAP,$(outbase).map)
-endef
-
+ ifeq ($(ld_debug),split)
+	$(TOOL_GCC64_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
+	$(CHMOD) a-x $(outbase).debug
+	$(TOOL_GCC64_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
+ endif
+endef
+
Index: /trunk/kBuild/tools/GXX.kmk
===================================================================
--- /trunk/kBuild/tools/GXX.kmk	(revision 2540)
+++ /trunk/kBuild/tools/GXX.kmk	(revision 2541)
@@ -206,4 +206,7 @@
 	$(QUIET)$(TOOL_GXX_LD) $(flags) -o $(out) $(objs) \
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
+if1of ($(ld_debug), split)
+ $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GXX.)
+endif
 endef
 
@@ -228,4 +231,7 @@
 	$(QUIET)$(TOOL_GXX_LD) $(TOOL_GXX_LDFLAGS.dll) $(flags) -o $(out) $(objs) \
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
-endef
-
+if1of ($(ld_debug), split)
+ $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GXX.)
+endif
+endef
+
Index: /trunk/kBuild/tools/GXX3.kmk
===================================================================
--- /trunk/kBuild/tools/GXX3.kmk	(revision 2540)
+++ /trunk/kBuild/tools/GXX3.kmk	(revision 2541)
@@ -275,7 +275,7 @@
 		$(call TOOL_GXX3_LD_MAP,$(outbase).map)
  ifeq ($(ld_debug),split)
-	$(TOOL_GXX32_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
+	$(TOOL_GXX3_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
 	$(CHMOD) a-x $(outbase).debug
-	$(TOOL_GXX32_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
+	$(TOOL_GXX3_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
  endif
 endef
@@ -304,5 +304,5 @@
 define TOOL_GXX3_LINK_DLL_CMDS
 	$(QUIET)$(TOOL_GXX3_LD) $(TOOL_GXX3_LDFLAGS.dll) $(flags) -o $(out)\
-		$(if $(filter-out win32 os2, $(KBUILD_TARGET)),$(call TOOL_GXX3_LD_SONAME,$(target),$(out)))\
+		$(if $(filter-out win os2, $(KBUILD_TARGET)),$(call TOOL_GXX3_LD_SONAME,$(target),$(out)))\
 		$(objs)\
 		$(filter %.def, $(othersrc))\
@@ -311,7 +311,7 @@
 		$(call TOOL_GXX3_LD_MAP,$(outbase).map)
  ifeq ($(ld_debug),split)
-	$(TOOL_GXX32_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
+	$(TOOL_GXX3_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
 	$(CHMOD) a-x $(outbase).debug
-	$(TOOL_GXX32_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
+	$(TOOL_GXX3_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
  endif
 endef
@@ -345,7 +345,7 @@
 		$(call TOOL_GXX3_LD_SYSMOD_MAP,$(outbase).map)
  ifeq ($(ld_debug),split)
-	$(TOOL_GXX32_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
+	$(TOOL_GXX3_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
 	$(CHMOD) a-x $(outbase).debug
-	$(TOOL_GXX32_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
+	$(TOOL_GXX3_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
  endif
 endef
Index: /trunk/kBuild/tools/GXX32.kmk
===================================================================
--- /trunk/kBuild/tools/GXX32.kmk	(revision 2540)
+++ /trunk/kBuild/tools/GXX32.kmk	(revision 2541)
@@ -101,5 +101,4 @@
 
 
-
 ## Compile C source.
 # @param    $(target)   Normalized main target name.
@@ -233,5 +232,8 @@
 	$(QUIET)$(APPEND) -n $(out).ar-script \
 		$(foreach o,$(objs), 'ADDMOD $(o)') \
-		$(foreach o,$(othersrc), 'ADDLIB $(o)')
+		$(foreach o,$(filter-out %.def %.imp,$(othersrc)), 'ADDLIB $(o)')
+	$(if $(filter %.def %.imp,$(othersrc))\
+		,$(TOOL_GXX3_AR_IMP) -o $(outbase).imp.a $(filter %.def %.imp,$(othersrc))\
+		 $(NL)$(TAB)$(QUIET)$(APPEND) $(out).ar-script 'ADDLIB $(outbase).imp.a')
 	$(QUIET)$(APPEND) $(out).ar-script 'SAVE'
 	$(QUIET)$(APPEND) $(out).ar-script 'END'
@@ -257,5 +259,6 @@
 TOOL_GXX32_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).debug
 TOOL_GXX32_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
-TOOL_GXX32_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
+TOOL_GXX32_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
+		$(filter %.def, $(othersrc))
 TOOL_GXX32_LINK_PROGRAM_DEPORD =
 define TOOL_GXX32_LINK_PROGRAM_CMDS
@@ -267,6 +270,5 @@
 	$(TOOL_GXX32_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
 	$(CHMOD) a-x $(outbase).debug
-	$(TOOL_GXX32_OBJCOPY) --strip-debug $(out)
-	$(TOOL_GXX32_OBJCOPY) --add-gnu-debuglink=$(outbase).debug $(out)
+	$(TOOL_GXX32_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
  endif
 endef
@@ -288,5 +290,8 @@
 TOOL_GXX32_LINK_DLL_OUTPUT =
 TOOL_GXX32_LINK_DLL_OUTPUT_MAYBE = $(outbase).map
-TOOL_GXX32_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
+TOOL_GXX32_LINK_DLL_OUTPUT_DEBUG = $(outbase).debug
+TOOL_GXX32_LINK_DLL_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
+TOOL_GXX32_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
+		$(filter %.def, $(othersrc))
 TOOL_GXX32_LINK_DLL_DEPORD =
 define TOOL_GXX32_LINK_DLL_CMDS
@@ -297,4 +302,9 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
 		$(call TOOL_GXX32_LD_MAP,$(outbase).map)
+ ifeq ($(ld_debug),split)
+	$(TOOL_GXX32_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
+	$(CHMOD) a-x $(outbase).debug
+	$(TOOL_GXX32_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
+ endif
 endef
 
@@ -315,11 +325,20 @@
 TOOL_GXX32_LINK_SYSMOD_OUTPUT =
 TOOL_GXX32_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
-TOOL_GXX32_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
+TOOL_GXX32_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).debug
+TOOL_GXX32_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
+TOOL_GXX32_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
+		$(filter %.def, $(othersrc))
 TOOL_GXX32_LINK_SYSMOD_DEPORD =
 define TOOL_GXX32_LINK_SYSMOD_CMDS
 	$(QUIET)$(TOOL_GXX32_LD_SYSMOD) $(TOOL_GXX32_LDFLAGS.sysmod) $(flags) -o $(out) $(objs)\
+		$(filter %.def, $(othersrc))\
 		$(foreach p,$(libpath), -L$(p))\
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
 		$(call TOOL_GXX32_LD_SYSMOD_MAP,$(outbase).map)
-endef
-
+ ifeq ($(ld_debug),split)
+	$(TOOL_GXX32_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
+	$(CHMOD) a-x $(outbase).debug
+	$(TOOL_GXX32_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
+ endif
+endef
+
Index: /trunk/kBuild/tools/GXX3PLAIN.kmk
===================================================================
--- /trunk/kBuild/tools/GXX3PLAIN.kmk	(revision 2540)
+++ /trunk/kBuild/tools/GXX3PLAIN.kmk	(revision 2541)
@@ -259,5 +259,5 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
 if1of ($(ld_debug), split)
- $(warning kBuild: Debug splitting is requrested for $(target), but this feature is not supported by GXX3PLAIN.)
+ $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GXX3PLAIN.)
 endif
 endef
@@ -290,5 +290,5 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
 if1of ($(ld_debug), split)
- $(warning kBuild: Debug splitting is requrested for $(target), but this feature is not supported by GXX3PLAIN.)
+ $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GXX3PLAIN.)
 endif
 endef
@@ -324,6 +324,6 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
 if1of ($(ld_debug), split)
- $(warning kBuild: Debug splitting is requrested for $(target), but this feature is not supported by GXX3PLAIN.)
-endif
-endef
-
+ $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GXX3PLAIN.)
+endif
+endef
+
Index: /trunk/kBuild/tools/GXX64.kmk
===================================================================
--- /trunk/kBuild/tools/GXX64.kmk	(revision 2540)
+++ /trunk/kBuild/tools/GXX64.kmk	(revision 2541)
@@ -66,6 +66,6 @@
 
 ifdef SLKRUNS
-TOOL_GXX64_CC  += -fmessage-length=0
-TOOL_GXX64_CXX += -fmessage-length=0
+ TOOL_GXX64_CC  += -fmessage-length=0
+ TOOL_GXX64_CXX += -fmessage-length=0
 endif
 
@@ -266,6 +266,5 @@
 	$(TOOL_GXX64_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
 	$(CHMOD) a-x $(outbase).debug
-	$(TOOL_GXX64_OBJCOPY) --strip-debug $(out)
-	$(TOOL_GXX64_OBJCOPY) --add-gnu-debuglink=$(outbase).debug $(out)
+	$(TOOL_GXX64_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
  endif
 endef
@@ -287,4 +286,6 @@
 TOOL_GXX64_LINK_DLL_OUTPUT =
 TOOL_GXX64_LINK_DLL_OUTPUT_MAYBE = $(outbase).map
+TOOL_GXX64_LINK_DLL_OUTPUT_DEBUG = $(outbase).debug
+TOOL_GXX64_LINK_DLL_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
 TOOL_GXX64_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
 TOOL_GXX64_LINK_DLL_DEPORD =
@@ -296,4 +297,9 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
 		$(call TOOL_GXX64_LD_MAP,$(outbase).map)
+ ifeq ($(ld_debug),split)
+	$(TOOL_GXX64_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
+	$(CHMOD) a-x $(outbase).debug
+	$(TOOL_GXX64_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
+ endif
 endef
 
@@ -314,4 +320,6 @@
 TOOL_GXX64_LINK_SYSMOD_OUTPUT =
 TOOL_GXX64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
+TOOL_GXX64_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).debug
+TOOL_GXX64_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
 TOOL_GXX64_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
 TOOL_GXX64_LINK_SYSMOD_DEPORD =
@@ -321,4 +329,9 @@
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
 		$(call TOOL_GXX64_LD_SYSMOD_MAP,$(outbase).map)
-endef
-
+ ifeq ($(ld_debug),split)
+	$(TOOL_GXX64_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
+	$(CHMOD) a-x $(outbase).debug
+	$(TOOL_GXX64_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
+ endif
+endef
+
