* paread.c (pa_symtab_read): Put file-local symbols in minimal symbols.
authorJim Kingdon <jkingdon@engr.sgi.com>
Fri, 30 Jul 1993 15:52:26 +0000 (15:52 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Fri, 30 Jul 1993 15:52:26 +0000 (15:52 +0000)
* hppa-tdep.c (frame_chain_valid): Check that our function has the
same address as _start, not that it must be the same symbol.

gdb/ChangeLog
gdb/hppa-tdep.c
gdb/paread.c

index 1e83925cad5712cab529e6a0f79b68c9fee1661c..4d457a457580b9d72badbfbac7040321ecc3da57 100644 (file)
@@ -12,6 +12,8 @@ Fri Jul 30 07:36:53 1993  Fred Fish  (fnf@deneb.cygnus.com)
 Fri Jul 30 08:58:01 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
 
        * paread.c (pa_symtab_read): Put file-local symbols in minimal symbols.
+       * hppa-tdep.c (frame_chain_valid): Check that our function has the
+       same address as _start, not that it must be the same symbol.
 
 Fri Jul 30 00:18:40 1993  Fred Fish  (fnf@deneb.cygnus.com)
 
index e8b3893c191938f3be8239cc2431718ff83810e1..3bae84585d27ec6a4ceae77fa3b4f38c52fdb9ca 100644 (file)
@@ -540,7 +540,8 @@ frame_chain_valid (chain, thisframe)
      FRAME_ADDR chain;
      FRAME thisframe;
 {
-  struct minimal_symbol *msym;
+  struct minimal_symbol *msym_us;
+  struct minimal_symbol *msym_start;
   struct unwind_table_entry *u;
 
   if (!chain)
@@ -548,9 +549,17 @@ frame_chain_valid (chain, thisframe)
 
   u = find_unwind_entry (thisframe->pc);
 
-  msym = lookup_minimal_symbol_by_pc (FRAME_SAVED_PC (thisframe));
-  if (msym
-      && (strcmp (SYMBOL_NAME (msym), "_start") == 0))
+  /* We can't just check that the same of msym_us is "_start", because
+     someone idiotically decided that they were going to make a Ltext_end
+     symbol with the same address.  This Ltext_end symbol is totally
+     indistinguishable (as nearly as I can tell) from the symbol for a function
+     which is (legitimately, since it is in the user's namespace)
+     named Ltext_end, so we can't just ignore it.  */
+  msym_us = lookup_minimal_symbol_by_pc (FRAME_SAVED_PC (thisframe));
+  msym_start = lookup_minimal_symbol ("_start", NULL);
+  if (msym_us
+      && msym_start
+      && SYMBOL_VALUE_ADDRESS (msym_us) == SYMBOL_VALUE_ADDRESS (msym_start))
     return 0;
 
   if (u == NULL)
index f8bd4bfc5a0a0b3467e6235cc4fbfdbf0c15d3e5..a4425a91c34615475febda51106edc1b8696f451 100644 (file)
@@ -157,7 +157,10 @@ pa_symtab_read (abfd, addr, objfile)
            }
          break;
 
+#if 0
+         /* SS_GLOBAL and SS_LOCAL are two names for the same thing (!).  */
        case SS_GLOBAL:
+#endif
        case SS_LOCAL:
          switch (bufp->symbol_type)
            {
@@ -167,19 +170,18 @@ pa_symtab_read (abfd, addr, objfile)
 
            case ST_CODE:
              symname = bufp->name.n_strx + stringtab;
+             ms_type = mst_file_text;
+             bufp->symbol_value &= ~0x3; /* clear out permission bits */
+
+           check_strange_names:
              /* GAS leaves symbols with the prefixes "LS$", "LBB$",
                 and "LBE$" in .o files after assembling.  And thus
                 they appear in the final executable.  This can
                 cause problems if these special symbols have the
-                same value as real symbols.  So ignore them.  Is this
-                meant as a feature, or is it just a GAS bug?  */
+                same value as real symbols.  So ignore them.  Also "LC$".  */
              if (*symname == 'L'
-                 && (symname[2] == '$' && symname[1] == 'S'
-                     || (symname[3] == '$' && symname[1] == 'B'
-                         && (symname[2] == 'B' || symname[2] == 'E'))))
+                 && (symname[2] == '$' || symname[3] == '$'))
                continue;
-             ms_type = mst_file_text;
-             bufp->symbol_value &= ~0x3; /* clear out permission bits */
              break;
 
            case ST_PRI_PROG:
@@ -190,13 +192,17 @@ pa_symtab_read (abfd, addr, objfile)
              ms_type = mst_file_text;
              bufp->symbol_value &= ~0x3; /* clear out permission bits */
              break;
+
            case ST_DATA:
              symname = bufp->name.n_strx + stringtab;
              ms_type = mst_file_data;
-             break;
+             goto check_strange_names;
+
            default:
              continue;
            }
+         break;
+
        default:
          continue;
        }
This page took 0.034527 seconds and 4 git commands to generate.