use remote-utils facilities for baud_rate
[deliverable/binutils-gdb.git] / gdb / dbxread.c
index 42bd4b4ceda3c4e3dd629375601804bc3d7d62c2..cc0c43ea9f7bdee82085178f13037a8bd227760b 100644 (file)
@@ -1356,7 +1356,6 @@ read_ofile_symtab (pst)
   unsigned char type;
   unsigned max_symnum;
   register bfd *abfd;
-  struct symtab *rtn;
   struct objfile *objfile;
   int sym_offset;              /* Offset to start of symbols to read */
   int sym_size;                        /* Size of symbols to read */
@@ -1810,7 +1809,10 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
        .stab "foo:V...",N_STSYM        is relative (section base subtracted).
        This leaves us no choice but to search for the 'S' or 'V'...
        (or pass the whole section_offsets stuff down ONE MORE function
-       call level, which we really don't want to do).  */
+       call level, which we really don't want to do).
+
+       The above is indeed true for Solaris 2.1.  I'm not sure what
+       happens in Solaris 2.3, in which ld stops relocating stabs.  */
       {
        char *p;
        p = strchr (name, ':');
@@ -1818,7 +1820,9 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
          {
            /* FIXME!  We relocate it by the TEXT offset, in case the
               whole module moved in memory.  But this is wrong, since
-              the sections can side around independently.  */
+              the sections can side around independently.  (I suspect that
+              the text offset is always zero anyway--elfread.c doesn't
+              process (and Sun cc doesn't produce) Ttext.text symbols).  */
            valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
            goto define_a_symbol;
          }
@@ -1912,7 +1916,15 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
                 previous function. This means that we can use the
                 minimal symbol table to get the address.  */
 
-             if (type == N_GSYM || type == N_STSYM)
+             /* On solaris up to 2.2, the N_FUN stab gets relocated.
+                On Solaris 2.3, ld no longer relocates stabs (which
+                is good), and the N_FUN's value is now always zero.
+                We only provide this correction for functions, not for
+                all N_FUN symbols, because that is easiest and all
+                readonly variables seem to go in the .rodata on Solaris.  */
+
+             if (type == N_GSYM || type == N_STSYM
+                 || (type == N_FUN && valu == 0))
                {
                  struct minimal_symbol *m;
                  int l = colon_pos - name;
@@ -2077,8 +2089,7 @@ elfstab_build_psymtabs (objfile, section_offsets, mainline,
   DBX_STRINGTAB_SIZE (objfile) = stabstrsize;
   DBX_SYMTAB_OFFSET  (objfile) = staboffset;
   
-  if (stabstrsize < 0  /* FIXME:  stabstrsize is unsigned; never true! */
-      || stabstrsize > bfd_get_size (sym_bfd))
+  if (stabstrsize > bfd_get_size (sym_bfd))
     error ("ridiculous string table size: %d bytes", stabstrsize);
   DBX_STRINGTAB (objfile) = (char *)
     obstack_alloc (&objfile->psymbol_obstack, stabstrsize+1);
This page took 0.024711 seconds and 4 git commands to generate.