diff --git a/gdb/defs.h b/gdb/defs.h
index 9e4800c..304d1c9 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -185,7 +185,9 @@ extern void quit (void);
 /* Languages represented in the symbol table and elsewhere.
    This should probably be in language.h, but since enum's can't
    be forward declared to satisfy opaque references before their
-   actual definition, needs to be here. */
+   actual definition, needs to be here.
+
+   When adding a tangible language also update language.c:mask_for_language */
 
 enum language
   {
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index bf36e01..e0d4d52 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -9646,6 +9646,7 @@ set_cu_language (unsigned int lang, struct dwarf2_cu *cu)
       break;
     }
   cu->language_defn = language_def (cu->language);
+  set_language_has_cu_loaded (cu->language);
 }
 
 /* Return the named attribute or NULL if not there.  */
diff --git a/gdb/language.c b/gdb/language.c
index 3ce08b5..2a8c727 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -435,6 +435,7 @@ set_language (enum language lang)
       if (languages[i]->la_language == lang)
 	{
 	  current_language = languages[i];
+	  set_language_has_cu_loaded(current_language->la_language);
 	  set_type_range_case ();
 	  break;
 	}
@@ -1060,6 +1061,83 @@ default_get_string (struct value *value, gdb_byte **buffer, int *length,
   error (_("Getting a string is unsupported in this language."));
 }
 
+
+/* A mask for langauges that want to enable specific behaviours if (not when) 
+   a compilation unit of that language has been loaded. the only one currently
+   in use is objc but i figured its best to make it a generic api */
+#define CU_LOADED_C_LANG_MASK		0x1 << 0
+#define CU_LOADED_CPLUS_LANG_MASK	0x1 << 1
+#define CU_LOADED_D_LANG_MASK		0x1 << 2
+#define CU_LOADED_OBJC_LANG_MASK	0x1 << 3
+#define CU_LOADED_JAVA_LANG_MASK	0x1 << 4
+#define CU_LOADED_FORTRAN_LANG_MASK	0x1 << 5
+#define CU_LOADED_M2_LANG_MASK		0x1 << 6
+#define CU_LOADED_ASM_LANG_MASK		0x1 << 7
+#define CU_LOADED_PASCAL_LANG_MASK	0x1 << 8
+#define CU_LOADED_ADA_LANG_MASK		0x1 << 9
+#define CU_LOADED_SCM_LANG_MASK		0x1 << 10
+
+static unsigned int cu_languages_loaded_mask;
+
+static unsigned int
+mask_for_language(enum language lang)
+{
+  unsigned int lang_mask;
+  switch(lang)
+    {
+      case language_c:			/* C */
+        lang_mask = CU_LOADED_C_LANG_MASK;
+      break;
+      case language_cplus:		/* C++ */
+        lang_mask = CU_LOADED_CPLUS_LANG_MASK;
+      break;
+      case language_d:			/* D */
+        lang_mask = CU_LOADED_D_LANG_MASK;
+      break;
+      case language_objc:		/* Objective-C */
+        lang_mask = CU_LOADED_OBJC_LANG_MASK;
+      break;
+      case language_java:		/* Java */
+        lang_mask = CU_LOADED_JAVA_LANG_MASK;
+      break;
+      case language_fortran:		/* Fortran */
+        lang_mask = CU_LOADED_FORTRAN_LANG_MASK;
+      break;
+      case language_m2:		/* Modula-2 */
+        lang_mask = CU_LOADED_M2_LANG_MASK;
+      break;
+      case language_asm:		/* Assembly language */
+        lang_mask = CU_LOADED_ASM_LANG_MASK;
+      break;
+      case language_pascal:		/* Pascal */
+        lang_mask = CU_LOADED_PASCAL_LANG_MASK;
+      break;
+      case language_ada:		/* Pascal */
+        lang_mask = CU_LOADED_ADA_LANG_MASK;
+      break;
+      case language_scm:		/* Pascal */
+        lang_mask = CU_LOADED_SCM_LANG_MASK;
+      break;
+      default:
+	return 0;
+    }
+  return lang_mask;
+}
+
+unsigned int
+language_has_cu_loaded (enum language lang)
+{
+  unsigned int lang_mask = mask_for_language (lang);
+  return cu_languages_loaded_mask & lang_mask;
+}
+
+void
+set_language_has_cu_loaded (enum language lang)
+{
+  unsigned int lang_mask = mask_for_language (lang);
+  cu_languages_loaded_mask |= lang_mask; 
+}
+
 /* Define the language that is no language.  */
 
 static int
diff --git a/gdb/language.h b/gdb/language.h
index aa0523b..6fde401 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -523,4 +523,12 @@ void default_get_string (struct value *value, gdb_byte **buffer, int *length,
 void c_get_string (struct value *value, gdb_byte **buffer, int *length,
 		   struct type **char_type, const char **charset);
 
+/* Returns non-zero if cu of the language type has been previously loaded. */
+unsigned int
+language_has_cu_loaded (enum language lang);
+
+/* Sets that a cu of the language type has been previously loaded. */
+void
+set_language_has_cu_loaded (enum language lang);
+
 #endif /* defined (LANGUAGE_H) */
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 91c5b90..4c7197f 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -771,14 +771,15 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
 
   /* Check if the symbol could be an Objective-C selector.  */
 
-  {
-    struct symtabs_and_lines values;
+  if (language_has_cu_loaded(language_objc))
+    {
+      struct symtabs_and_lines values;
 
-    values = decode_objc (argptr, funfirstline, NULL,
+      values = decode_objc (argptr, funfirstline, NULL,
 			  canonical, saved_arg);
-    if (values.sals != NULL)
-      return values;
-  }
+      if (values.sals != NULL)
+        return values;
+    }
 
   /* Does it look like there actually were two parts?  */
 
