* gdbarch.sh: Document the return_value method. Explain that
[deliverable/binutils-gdb.git] / gdb / somread.c
index 7f3130303a5c13983fc9c8bc39c9ff49b516f85d..a3389d9d2b2104b8b12d15c38fec143a3e4f2f6e 100644 (file)
@@ -1,13 +1,13 @@
 /* Read HP PA/Risc object files for GDB.
    Copyright (C) 1991, 1992, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
 /* Read HP PA/Risc object files for GDB.
    Copyright (C) 1991, 1992, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
-   2004, 2007 Free Software Foundation, Inc.
+   2004, 2007, 2008 Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support.
 
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    Written by Fred Fish at Cygnus Support.
 
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -16,9 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "bfd.h"
 
 #include "defs.h"
 #include "bfd.h"
@@ -60,6 +58,7 @@ static void
 som_symtab_read (bfd *abfd, struct objfile *objfile,
                 struct section_offsets *section_offsets)
 {
 som_symtab_read (bfd *abfd, struct objfile *objfile,
                 struct section_offsets *section_offsets)
 {
+  struct gdbarch *gdbarch = get_objfile_arch (objfile);
   unsigned int number_of_symbols;
   int val, dynamic;
   char *stringtab;
   unsigned int number_of_symbols;
   int val, dynamic;
   char *stringtab;
@@ -133,7 +132,8 @@ som_symtab_read (bfd *abfd, struct objfile *objfile,
              symname = bufp->name.n_strx + stringtab;
              ms_type = mst_text;
              bufp->symbol_value += text_offset;
              symname = bufp->name.n_strx + stringtab;
              ms_type = mst_text;
              bufp->symbol_value += text_offset;
-             bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value);
+             bufp->symbol_value = gdbarch_smash_text_address
+                                    (gdbarch, bufp->symbol_value);
              break;
 
            case ST_ENTRY:
              break;
 
            case ST_ENTRY:
@@ -146,14 +146,16 @@ som_symtab_read (bfd *abfd, struct objfile *objfile,
              else
                ms_type = mst_text;
              bufp->symbol_value += text_offset;
              else
                ms_type = mst_text;
              bufp->symbol_value += text_offset;
-             bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value);
+             bufp->symbol_value = gdbarch_smash_text_address
+                                    (gdbarch, bufp->symbol_value);
              break;
 
            case ST_STUB:
              symname = bufp->name.n_strx + stringtab;
              ms_type = mst_solib_trampoline;
              bufp->symbol_value += text_offset;
              break;
 
            case ST_STUB:
              symname = bufp->name.n_strx + stringtab;
              ms_type = mst_solib_trampoline;
              bufp->symbol_value += text_offset;
-             bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value);
+             bufp->symbol_value = gdbarch_smash_text_address
+                                    (gdbarch, bufp->symbol_value);
              break;
 
            case ST_DATA:
              break;
 
            case ST_DATA:
@@ -181,7 +183,8 @@ som_symtab_read (bfd *abfd, struct objfile *objfile,
              symname = bufp->name.n_strx + stringtab;
              ms_type = mst_file_text;
              bufp->symbol_value += text_offset;
              symname = bufp->name.n_strx + stringtab;
              ms_type = mst_file_text;
              bufp->symbol_value += text_offset;
-             bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value);
+             bufp->symbol_value = gdbarch_smash_text_address
+                                    (gdbarch, bufp->symbol_value);
 
            check_strange_names:
              /* Utah GCC 2.5, FSF GCC 2.6 and later generate correct local
 
            check_strange_names:
              /* Utah GCC 2.5, FSF GCC 2.6 and later generate correct local
@@ -212,7 +215,8 @@ som_symtab_read (bfd *abfd, struct objfile *objfile,
              symname = bufp->name.n_strx + stringtab;
              ms_type = mst_file_text;
              bufp->symbol_value += text_offset;
              symname = bufp->name.n_strx + stringtab;
              ms_type = mst_file_text;
              bufp->symbol_value += text_offset;
-             bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value);
+             bufp->symbol_value = gdbarch_smash_text_address
+                                    (gdbarch, bufp->symbol_value);
              break;
 
            case ST_ENTRY:
              break;
 
            case ST_ENTRY:
@@ -223,14 +227,16 @@ som_symtab_read (bfd *abfd, struct objfile *objfile,
                 we do for SS_UNIVERSAL and SS_EXTERNAL symbols above.  */
              ms_type = mst_file_text;
              bufp->symbol_value += text_offset;
                 we do for SS_UNIVERSAL and SS_EXTERNAL symbols above.  */
              ms_type = mst_file_text;
              bufp->symbol_value += text_offset;
-             bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value);
+             bufp->symbol_value = gdbarch_smash_text_address
+                                    (gdbarch, bufp->symbol_value);
              break;
 
            case ST_STUB:
              symname = bufp->name.n_strx + stringtab;
              ms_type = mst_solib_trampoline;
              bufp->symbol_value += text_offset;
              break;
 
            case ST_STUB:
              symname = bufp->name.n_strx + stringtab;
              ms_type = mst_solib_trampoline;
              bufp->symbol_value += text_offset;
-             bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value);
+             bufp->symbol_value = gdbarch_smash_text_address
+                                    (gdbarch, bufp->symbol_value);
              break;
 
 
              break;
 
 
@@ -431,6 +437,9 @@ static struct sym_fns som_sym_fns =
   som_symfile_read,            /* sym_read: read a symbol file into symtab */
   som_symfile_finish,          /* sym_finish: finished with file, cleanup */
   som_symfile_offsets,         /* sym_offsets:  Translate ext. to int. relocation */
   som_symfile_read,            /* sym_read: read a symbol file into symtab */
   som_symfile_finish,          /* sym_finish: finished with file, cleanup */
   som_symfile_offsets,         /* sym_offsets:  Translate ext. to int. relocation */
+  default_symfile_segments,    /* sym_segments: Get segment information from
+                                  a file.  */
+  NULL,                         /* sym_read_linetable */
   NULL                         /* next: pointer to next struct sym_fns */
 };
 
   NULL                         /* next: pointer to next struct sym_fns */
 };
 
This page took 0.026162 seconds and 4 git commands to generate.