* v850-opc.c (v850_operands): Add V850_OPERAND_SIGNED flag
[deliverable/binutils-gdb.git] / gdb / minsyms.c
index 6c22d6cd8512774b4ce28c74a9f09c53a3440b26..608ae70e04c1e57489a7b42c3883c6f02e9b59e7 100644 (file)
@@ -322,6 +322,12 @@ lookup_minimal_symbol_by_pc (pc)
   register struct minimal_symbol *msymbol;
   register struct minimal_symbol *best_symbol = NULL;
 
+  /* pc has to be in a known section. This ensures that anything beyond
+     the end of the last segment doesn't appear to be part of the last
+     function in the last segment.  */
+  if (find_pc_section (pc) == NULL)
+    return NULL;
+
   for (objfile = object_files;
        objfile != NULL;
        objfile = objfile -> next)
@@ -499,6 +505,7 @@ prim_record_minimal_symbol (name, address, ms_type, objfile)
 
 /* Record a minimal symbol in the msym bunches.  Returns the symbol
    newly created.  */
+
 struct minimal_symbol *
 prim_record_minimal_symbol_and_info (name, address, ms_type, info, section,
                                     objfile)
@@ -541,7 +548,8 @@ prim_record_minimal_symbol_and_info (name, address, ms_type, info, section,
       msym_bunch = new;
     }
   msymbol = &msym_bunch -> contents[msym_bunch_index];
-  SYMBOL_NAME (msymbol) = (char *) name;
+  SYMBOL_NAME (msymbol) = obsavestring ((char *) name, strlen (name),
+                                       &objfile->symbol_obstack);
   SYMBOL_INIT_LANGUAGE_SPECIFIC (msymbol, language_unknown);
   SYMBOL_VALUE_ADDRESS (msymbol) = address;
   SYMBOL_SECTION (msymbol) = section;
This page took 0.025658 seconds and 4 git commands to generate.