aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib.c
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2000-04-17 16:09:04 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2000-04-17 16:09:04 +0000
commite7cf9df194baf9fe94e8d3e10d61a33d67b4c808 (patch)
tree552e434e76e7797b885a89a89f85d4e07930f183 /gdb/solib.c
parent4da95fc42df75a193df496af6fd5013f7c46ea1c (diff)
downloadgdb-e7cf9df194baf9fe94e8d3e10d61a33d67b4c808.zip
gdb-e7cf9df194baf9fe94e8d3e10d61a33d67b4c808.tar.gz
gdb-e7cf9df194baf9fe94e8d3e10d61a33d67b4c808.tar.bz2
2000-04-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* symfile.h (struct section_addr_info ): Remove fields for special treatment of .text, .data and .bss sections. * solib.c (symbol_add_stub): The special field text_addr is not available anymore. Search for the .text field the hard way. * symfile.c (build_section_addr_info_from_section_table): Don't fill in {text, data, bss}_addr any more. (default_symfile_offsets): Don't use {text, data, bss}_addr fields to fill in section_offsets for objfile. (syms_from_objfile): Don't deal with {text, data, bss}_addr as a special case anymore. (add_symbol_file_command): Ditto.
Diffstat (limited to 'gdb/solib.c')
-rw-r--r--gdb/solib.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/solib.c b/gdb/solib.c
index ded9fae..fe3265e 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1155,6 +1155,8 @@ symbol_add_stub (arg)
register struct so_list *so = (struct so_list *) arg; /* catch_errs bogon */
CORE_ADDR text_addr = 0;
struct section_addr_info *sap;
+ int i;
+ asection *text_section;
/* Have we already loaded this shared object? */
ALL_OBJFILES (so->objfile)
@@ -1183,7 +1185,14 @@ symbol_add_stub (arg)
sap = build_section_addr_info_from_section_table (so->sections,
so->sections_end);
- sap->text_addr = text_addr;
+
+ /* Look for the index for the .text section in the sap structure. */
+ text_section = bfd_get_section_by_name (so->abfd, ".text");
+ for (i = 0; i < MAX_SECTIONS && sap->other[i].name; i++)
+ if (sap->other[i].sectindex == text_section->index)
+ break;
+
+ sap->other[i].addr = text_addr;
so->objfile = symbol_file_add (so->so_name, so->from_tty,
sap, 0, OBJF_SHARED);
free_section_addr_info (sap);