diff --git a/recipes/crosstool-ng/gcc-configure.inc b/recipes/crosstool-ng/gcc-configure.inc
index 31e3f8a..693a986 100644
--- a/recipes/crosstool-ng/gcc-configure.inc
+++ b/recipes/crosstool-ng/gcc-configure.inc
@@ -31,6 +31,7 @@ _CT_LIBELF_V			= "CT_LIBELF_V"
 _CT_LTRACE_V			= "CT_LTRACE_V"
 _CT_STRACE_V			= "CT_STRACE_V"
 _CT_MINGW_PDCURSES_V		= "CT_MINGW_PDCURSES_V"
+_CT_DMALLOC_V			= "CT_DMALLOC_V"
 
 _CT_LIBC_VERSION		= "CT_LIBC_VERSION"
 _CT_LIBC_VERSION:TARGET_OS_mingw32 = "CT_MINGWRT_VERSION"
@@ -68,6 +69,16 @@ AUTO_CT_BOOLEAN_VARS += "CT_DEBUG_strace"
 CT_DEBUG_strace:cross		= "y"
 CT_DEBUG_strace:TARGET_OS_mingw32 = ""
 
+RECIPE_FLAGS += "dmalloc"
+DEFAULT_USE_dmalloc = ""
+INC_DMALLOC = ""
+INC_DMALLOC:USE_dmalloc = "${USE_dmalloc}"
+INC_DMALLOC:sdk-cross = ""
+INC_DMALLOC:canadian-cross = ""
+
+AUTO_CT_BOOLEAN_VARS:USE_dmalloc	+= "CT_DEBUG_dmalloc"
+CT_DEBUG_dmalloc:cross			= "${INC_DMALLOC}"
+
 AUTO_CT_BOOLEAN_VARS += "CT_ARCH_ARM_MODE_THUMB"
 CT_ARCH_ARM_MODE_THUMB          = "${TARGET_THUMB}"
 
@@ -213,7 +224,7 @@ def do_configure_defconfig(d):
 
     for component in ("cc", "binutils", "libc", "gdb", "gmp", "mpfr", "mpc",
                       "ppl", "cloog", "libelf", "ltrace", "strace",
-                      "mingw_pdcurses"):
+                      "mingw_pdcurses", "dmalloc"):
         rewrites.append(version_rewrite(component))
 
     ct_libc = d.get("CT_LIBC")
@@ -311,4 +322,6 @@ def do_configure_qa(d):
         ok = ok and check_version("CT_STRACE_VERSION")
     if d.get("CT_USE_PDCURSES"):
         ok = ok and check_version("CT_MINGW_PDCURSES_VERSION")
+    if d.get("CT_DEBUG_dmalloc"):
+	ok = ok and check_version("CT_DMALLOC_VERSION")
     return ok
diff --git a/recipes/crosstool-ng/gcc-fetch.inc b/recipes/crosstool-ng/gcc-fetch.inc
index 12d6f94..2199a2d 100644
--- a/recipes/crosstool-ng/gcc-fetch.inc
+++ b/recipes/crosstool-ng/gcc-fetch.inc
@@ -50,6 +50,8 @@ SRC_URI_MPC = "http://www.multiprecision.org/mpc/download/mpc-${CT_MPC_VERSION}.
 
 SRC_URI_STRACE = "${SOURCEFORGE_MIRROR}/project/strace/strace/${CT_STRACE_VERSION}/strace-${CT_STRACE_VERSION}.tar.bz2;unpack=0"
 
+SRC_URI_DMALLOC = "http://dmalloc.com/releases/dmalloc-${CT_DMALLOC_VERSION}.tgz;unpack=0"
+
 SRC_URI_LTRACE = "${DEBIAN_MIRROR}/main/l/ltrace/ltrace_${CT_LTRACE_VERSION}.orig.tar.gz;unpack=0"
 
 SRC_URI_PDCURSES = "${SOURCEFORGE_MIRROR}/pdcurses/PDCurses-${CT_MINGW_PDCURSES_VERSION}.tar.gz;unpack=0"
@@ -107,6 +109,8 @@ def gcc_set_src_uri(d):
         add_src("SRC_URI_STRACE")
     if target_is_mingw:
         add_src("SRC_URI_PDCURSES", "CT_USE_PDCURSES")
+    if d.get("CT_DEBUG_dmalloc"):
+	add_src("SRC_URI_DMALLOC")
     # FIXME: add support for adding cloog and ppl
 
 
diff --git a/recipes/crosstool-ng/gcc-package.inc b/recipes/crosstool-ng/gcc-package.inc
index e3e40d8..1d6a771 100644
--- a/recipes/crosstool-ng/gcc-package.inc
+++ b/recipes/crosstool-ng/gcc-package.inc
@@ -151,6 +151,30 @@ ${base_prefix}/${TARGET_ARCH}/debug-root${target_sysconfdir}/ltrace.conf \
 "
 PROVIDES_${PN}-sysroot-trace += "util/ltrace util/strace"
 
+TARGET_PACKAGES += "${PN}-sysroot-dmalloc-dbg"
+FILES_${PN}-sysroot-dmalloc-dbg = "\
+${base_prefix}/${TARGET_ARCH}/debug-root${target_bindir}/.debug/dmalloc \
+${base_prefix}/${TARGET_ARCH}/debug-root${target_libdir}/.debug/dmalloc \
+"
+
+TARGET_PACKAGES += "${PN}-sysroot-dmalloc"
+FILES_${PN}-sysroot-dmalloc = "\
+${base_prefix}/${TARGET_ARCH}/debug-root${target_bindir}/dmalloc \
+"
+PROVIDES_${PN}-sysroot-dmalloc += "util/dmalloc"
+
+TARGET_PACKAGES += "${PN}-sysroot-libdmalloc"
+FILES_${PN}-sysroot-libdmalloc = "\
+${base_prefix}/${TARGET_ARCH}/sysroot${target_libdir}/libdmalloc*.a \
+"
+
+TARGET_PACKAGES += "${PN}-sysroot-lib-so-dmalloc"
+FILES_${PN}-sysroot-lib-so-dmalloc = "\
+${base_prefix}/${TARGET_ARCH}/sysroot${target_libdir}/libdmalloc*.so \
+"
+
+
+
 TARGET_PACKAGES += "${PN}-sysroot-trace-doc"
 FILES_${PN}-sysroot-trace-doc = "\
 ${base_prefix}/${TARGET_ARCH}/debug-root${target_infodir}/*trace \
@@ -426,3 +450,4 @@ LICENSE_${PN}-sysroot-libfd		= "GPL-3.0+"
 
 LICENSE_${PN}-sysroot-gdbserver		= "GPL-2.0 & GPL-3.0 & LGPL-2.0 & LGPL-3.0"
 LICENSE_${PN}-sysroot-trace		= "BSD-2-Clause"
+LICENSE_${PN}-sysroot-dmalloc		= "CC-BY-NC-SA-3.0"
diff --git a/recipes/crosstool-ng/gcc-versions.inc b/recipes/crosstool-ng/gcc-versions.inc
index c23a3ba..7116c82 100644
--- a/recipes/crosstool-ng/gcc-versions.inc
+++ b/recipes/crosstool-ng/gcc-versions.inc
@@ -73,3 +73,7 @@ RECIPE_FLAGS		+= "toolchain_strace_version"
 
 CT_MINGW_PDCURSES_VERSION = "${USE_toolchain_pdcurses_version}"
 RECIPE_FLAGS		+= "toolchain_pdcurses_version"
+
+CT_DMALLOC_VERSION	= "${USE_toolchain_dmalloc_version}"
+RECIPE_FLAGS		+= "toolchain_dmalloc_version"
+
diff --git a/recipes/crosstool-ng/gcc_1.13.2.oe b/recipes/crosstool-ng/gcc_1.13.2.oe
index ca1d6b6..b8ae9fa 100644
--- a/recipes/crosstool-ng/gcc_1.13.2.oe
+++ b/recipes/crosstool-ng/gcc_1.13.2.oe
@@ -34,6 +34,7 @@ DEFAULT_USE_toolchain_cloog_version		= "0.15.11"
 DEFAULT_USE_toolchain_libelf_version		= "0.8.13"
 DEFAULT_USE_toolchain_ltrace_version		= "0.5.3"
 DEFAULT_USE_toolchain_strace_version		= "4.5.20"
+DEFAULT_USE_toolchain_dmalloc_version		= "5.5.2"
 
 require gcc.inc
 
diff --git a/recipes/crosstool-ng/gcc_1.13.2.oe.sig b/recipes/crosstool-ng/gcc_1.13.2.oe.sig
index cca7d3f..0264469 100644
--- a/recipes/crosstool-ng/gcc_1.13.2.oe.sig
+++ b/recipes/crosstool-ng/gcc_1.13.2.oe.sig
@@ -1,5 +1,6 @@
 e36684442a6171cc3a5165c8c49c70f67db7288c  PDCurses-3.4.tar.gz
 3f0e3746a15f806a95dd079be2a7f43c17b18818  binutils-2.20.1a.tar.bz2
+20719de78decbd724bc3ab9d6dce2ea5e5922335  dmalloc-5.5.2.tgz
 45d1e7242a08cbb7a343ed2bf640a5afd0ebe098  gcc-4.4.4.tar.bz2
 2b1427a932a620c909d74f1e4821ed90c90fd350  gcc-4.4.5.tar.bz2
 73c45dfda5eef6b124be53e56828b5925198cc1b  gcc-4.5.3.tar.bz2
