diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6ee11b544c3569c8ef0cb16f78fa34e04a08843f..f15b03e98bd1d830f8073c4387fc0ebf25020e7c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2006-03-05  Robert Millan  <robertmh@gnu.org>
+
+	* gcc/config/i386/linux.h:  Add a comment to mark macros that are
+	being overriden in config/k*bsd-gnu.h.
+	* gcc/config/kfreebsd-gnu.h:  Redefine GLIBC_DYNAMIC_LINKER instead of
+	DYNAMIC_LINKER.
+	* gcc/config/knetbsd-gnu.h:  Ditto.
+
 2006-04-06  Jan Hubicka  <jh@suse.cz>
 
 	PR profile/20815
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index ec171353c3315f824f27d29693ad9a293a77f065..7eb2395b6d918f6384e568743ec53177d955b485 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -99,6 +99,7 @@ Boston, MA 02110-1301, USA.  */
 
 /* If ELF is the default format, we should not use /lib/elf.  */
 
+/* These macros may be overridden in k*bsd-gnu.h and i386/k*bsd-gnu.h. */
 #define LINK_EMULATION "elf_i386"
 #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
 
diff --git a/gcc/config/kfreebsd-gnu.h b/gcc/config/kfreebsd-gnu.h
index 60cbefcd1a13d8dc4b99b3fd7f890cf9f2654171..8c11ca501379895ab9448e764f7e7d591f5c3bd5 100644
--- a/gcc/config/kfreebsd-gnu.h
+++ b/gcc/config/kfreebsd-gnu.h
@@ -1,5 +1,5 @@
 /* Definitions for kFreeBSD-based GNU systems with ELF format
-   Copyright (C) 2004
+   Copyright (C) 2004, 2006
    Free Software Foundation, Inc.
    Contributed by Robert Millan.
 
@@ -32,5 +32,7 @@ Boston, MA 02110-1301, USA.  */
     }						\
   while (0)
 
-#undef DYNAMIC_LINKER
-#define DYNAMIC_LINKER "/lib/ld.so.1"
+#ifdef GLIBC_DYNAMIC_LINKER
+#undef GLIBC_DYNAMIC_LINKER
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+#endif
diff --git a/gcc/config/knetbsd-gnu.h b/gcc/config/knetbsd-gnu.h
index 72a3b8d20e37527408977a148f8db5c410a3cea3..e1ff325b87c476723db68998859f293d0ad8c473 100644
--- a/gcc/config/knetbsd-gnu.h
+++ b/gcc/config/knetbsd-gnu.h
@@ -1,5 +1,5 @@
 /* Definitions for kNetBSD-based GNU systems with ELF format
-   Copyright (C) 2004
+   Copyright (C) 2004, 2006
    Free Software Foundation, Inc.
    Contributed by Robert Millan.
 
@@ -32,5 +32,8 @@ Boston, MA 02110-1301, USA.  */
     }						\
   while (0)
 
-#undef DYNAMIC_LINKER
-#define DYNAMIC_LINKER "/lib/ld.so.1"
+
+#ifdef GLIBC_DYNAMIC_LINKER
+#undef GLIBC_DYNAMIC_LINKER
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+#endif