diff --git a/gprof/corefile.c b/gprof/corefile.c
index 712dd243e90..b79da05e7b2 100644
--- a/gprof/corefile.c
+++ b/gprof/corefile.c
@@ -881,7 +881,7 @@ core_create_line_syms (void)
 
 	    if (!get_src_info (vma, &filename, &ltab.limit->name,
 			       &ltab.limit->line_num)
-		|| (prev.name && prev.line_num == ltab.limit->line_num
+		|| (prev.name && (!line_granularity || prev.line_num == ltab.limit->line_num)
 		    && strcmp (prev.name, ltab.limit->name) == 0
 		    && filename_cmp (prev.file->name, filename) == 0))
 	      continue;
diff --git a/gprof/gprof.c b/gprof/gprof.c
index cea269bc80f..926581fe17e 100644
--- a/gprof/gprof.c
+++ b/gprof/gprof.c
@@ -641,10 +641,8 @@ symtab_init (void)
   /* Create symbols from core image.  */
   if (external_symbol_table)
     core_create_syms_from (external_symbol_table);
-  else if (line_granularity)
-    core_create_line_syms ();
   else
-    core_create_function_syms ();
+    core_create_line_syms ();
 
   /* Translate sym specs into syms.  */
   sym_id_parse ();
