* inftarg.c (child_thread_alive): New function to see if a
[deliverable/binutils-gdb.git] / gdb / somread.c
index 35def2254abbf707e931670350ee267e978b469f..bee059d281ac74bdf830155f614c93b620d1c882 100644 (file)
@@ -103,11 +103,11 @@ som_symtab_read (abfd, objfile, section_offsets)
   struct symbol_dictionary_record *buf, *bufp, *endbufp;
   char *symname;
   CONST int symsize = sizeof (struct symbol_dictionary_record);
-  CORE_ADDR text_offset;
+  CORE_ADDR text_offset, data_offset;
 
 
-  /* FIXME.  Data stuff needs dynamic relocation too!  */
   text_offset = ANOFFSET (section_offsets, 0);
+  data_offset = ANOFFSET (section_offsets, 1);
 
   number_of_symbols = bfd_get_symcount (abfd);
 
@@ -190,6 +190,7 @@ som_symtab_read (abfd, objfile, section_offsets)
 
            case ST_DATA:
              symname = bufp->name.n_strx + stringtab;
+             bufp->symbol_value += data_offset;
              ms_type = mst_data;
              break;
            default:
@@ -226,9 +227,15 @@ som_symtab_read (abfd, objfile, section_offsets)
                 the nasty habit of placing section symbols from the literal
                 subspaces in the middle of the program's text.  Filter
                 those out as best we can.  Check for first and last character
-                being '$'.  */
+                being '$'. 
+
+                And finally, the newer HP compilers emit crud like $PIC_foo$N
+                in some circumstance (PIC code I guess).  It's also claimed
+                that they emit D$ symbols too.  What stupidity.  */
              if ((symname[0] == 'L' && symname[1] == '$')
-                 || (symname[0] == '$' && symname[strlen(symname) - 1] == '$'))
+                 || (symname[0] == '$' && symname[strlen(symname) - 1] == '$')
+                 || (symname[0] == 'D' && symname[1] == '$')
+                 || (strncmp (symname, "$PIC", 4) == 0))
                continue;
              break;
 
@@ -270,6 +277,7 @@ som_symtab_read (abfd, objfile, section_offsets)
 
            case ST_DATA:
              symname = bufp->name.n_strx + stringtab;
+             bufp->symbol_value += data_offset;
              ms_type = mst_file_data;
              goto check_strange_names;
 
@@ -341,17 +349,15 @@ som_symfile_read (objfile, section_offsets, mainline)
   stabsect_build_psymtabs (objfile, section_offsets, mainline,
                           "$GDB_SYMBOLS$", "$GDB_STRINGS$", "$TEXT$");
 
-/* start-sanitize-hpread */
   /* Now read the native debug information.  */
   hpread_build_psymtabs (objfile, section_offsets, mainline);
-/* end-sanitize-hpread */
 
   /* Install any minimal symbols that have been collected as the current
      minimal symbols for this objfile.  */
   install_minimal_symbols (objfile);
 
   /* Force hppa-tdep.c to re-read the unwind descriptors.  */
-  OBJ_UNWIND_INFO (objfile) = NULL;
+  objfile->obj_private = NULL;
   do_cleanups (back_to);
 }
 
@@ -382,9 +388,7 @@ som_symfile_finish (objfile)
     {
       mfree (objfile -> md, objfile -> sym_stab_info);
     }
-/* start-sanitize-hpread */
   hpread_symfile_finish (objfile);
-/* end-sanitize-hpread */
 }
 
 /* SOM specific initialization routine for reading symbols.
@@ -394,9 +398,7 @@ static void
 som_symfile_init (objfile)
      struct objfile *objfile;
 {
-/* start-sanitize-hpread */
   hpread_symfile_init (objfile);
-/* end-sanitize-hpread */
 }
 
 /* SOM specific parsing routine for section offsets.
@@ -417,8 +419,13 @@ som_symfile_offsets (objfile, addr)
                   sizeof (struct section_offsets)
                   + sizeof (section_offsets->offsets) * (SECT_OFF_MAX-1));
 
-  for (i = 0; i < SECT_OFF_MAX; i++)
-    ANOFFSET (section_offsets, i) = addr;
+  /* First see if we're a shared library.  If so, get the section
+     offsets from the library, else get them from addr.  */
+  if (!som_solib_section_offsets (objfile, section_offsets))
+    {
+      for (i = 0; i < SECT_OFF_MAX; i++)
+       ANOFFSET (section_offsets, i) = addr;
+    }
 
   return section_offsets;
 }
This page took 0.024173 seconds and 4 git commands to generate.