diff options
author | Jeff Law <law@redhat.com> | 1995-02-09 19:16:47 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1995-02-09 19:16:47 +0000 |
commit | 506af7a79c56669ddd04f9da63c2d48d048615a6 (patch) | |
tree | 9f9e03580efd100e345115481efc074091b675f3 /gdb/somread.c | |
parent | 257fcf3621d67bcd447e05500399e252c4cfdd79 (diff) | |
download | gdb-506af7a79c56669ddd04f9da63c2d48d048615a6.zip gdb-506af7a79c56669ddd04f9da63c2d48d048615a6.tar.gz gdb-506af7a79c56669ddd04f9da63c2d48d048615a6.tar.bz2 |
* somread.c (som_symtab_read): Handle dynamic relocation for both
text and data symbols.
(som_symfile_offsets): If objfile is a shared library, then get
text and data offsets from the shared library structures.
* somsolib.c (som_solib_add): Copy the bfd pointer from the
objfile rather than reopening the file again.
(som_solib_section_offsets): New function.
* somsolib.h (som_solib_section_offsets): Declare.
Diffstat (limited to 'gdb/somread.c')
-rw-r--r-- | gdb/somread.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gdb/somread.c b/gdb/somread.c index afb7642..ae04617 100644 --- a/gdb/somread.c +++ b/gdb/somread.c @@ -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: @@ -270,6 +271,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; @@ -411,8 +413,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; } |