aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile.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/symfile.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/symfile.c')
-rw-r--r--gdb/symfile.c87
1 files changed, 5 insertions, 82 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 5d847f0..108695a 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -478,13 +478,6 @@ build_section_addr_info_from_section_table (const struct section_table *start,
for (stp = start, oidx = 0; stp != end; stp++)
{
- if (strcmp (stp->the_bfd_section->name, ".text") == 0)
- sap->text_addr = stp->addr;
- else if (strcmp (stp->the_bfd_section->name, ".data") == 0)
- sap->data_addr = stp->addr;
- else if (strcmp (stp->the_bfd_section->name, ".bss") == 0)
- sap->bss_addr = stp->addr;
-
if (stp->the_bfd_section->flags & (SEC_ALLOC | SEC_LOAD)
&& oidx < MAX_SECTIONS)
{
@@ -531,15 +524,6 @@ default_symfile_offsets (objfile, addrs)
obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
memset (objfile->section_offsets, 0, SIZEOF_SECTION_OFFSETS);
- /* If user explicitly specified values for data and bss, set them here. */
-
- if (addrs->text_addr)
- ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT) = addrs->text_addr;
- if (addrs->data_addr)
- ANOFFSET (objfile->section_offsets, SECT_OFF_DATA) = addrs->data_addr;
- if (addrs->bss_addr)
- ANOFFSET (objfile->section_offsets, SECT_OFF_BSS) = addrs->bss_addr;
-
/* Now calculate offsets for other sections. */
for (i = 0; i < MAX_SECTIONS && addrs->other[i].name; i++)
{
@@ -635,14 +619,7 @@ syms_from_objfile (objfile, addrs, mainline, verbo)
We no longer warn if the lowest section is not a text segment (as
happens for the PA64 port. */
- if (mainline)
- {
- /* No offset from objfile addresses. */
- addrs -> text_addr = 0;
- addrs -> data_addr = 0;
- addrs -> bss_addr = 0;
- }
- else
+ if (!mainline)
{
/* Find lowest loadable section to be used as starting point for
continguous sections. FIXME!! won't work without call to find
@@ -675,57 +652,17 @@ syms_from_objfile (objfile, addrs, mainline, verbo)
(the loadable section directly below it in memory).
this_offset = lower_offset = lower_addr - lower_orig_addr */
- /* FIXME: These sections will not need special treatment because ALL
- sections are in the other sections table */
-
- if (addrs->text_addr != 0)
- {
- sect = bfd_get_section_by_name (objfile->obfd, ".text");
- if (sect)
- {
- addrs->text_addr -= bfd_section_vma (objfile->obfd, sect);
- lower_offset = addrs->text_addr;
- }
- }
- else
- /* ??? who's below me? */
- addrs->text_addr = lower_offset;
-
- if (addrs->data_addr != 0)
- {
- sect = bfd_get_section_by_name (objfile->obfd, ".data");
- if (sect)
- {
- addrs->data_addr -= bfd_section_vma (objfile->obfd, sect);
- lower_offset = addrs->data_addr;
- }
- }
- else
- addrs->data_addr = lower_offset;
-
- if (addrs->bss_addr != 0)
- {
- sect = bfd_get_section_by_name (objfile->obfd, ".bss");
- if (sect)
- {
- addrs->bss_addr -= bfd_section_vma (objfile->obfd, sect);
- lower_offset = addrs->bss_addr;
- }
- }
- else
- addrs->bss_addr = lower_offset;
-
- /* Now calculate offsets for other sections. */
+ /* Calculate offsets for sections. */
for (i=0 ; i < MAX_SECTIONS && addrs->other[i].name; i++)
{
-
- if (addrs->other[i].addr != 0)
+ if (addrs->other[i].addr != 0)
{
- sect=bfd_get_section_by_name(objfile->obfd, addrs->other[i].name);
+ sect = bfd_get_section_by_name (objfile->obfd, addrs->other[i].name);
if (sect)
{
addrs->other[i].addr -= bfd_section_vma (objfile->obfd, sect);
lower_offset = addrs->other[i].addr;
+ /* This is the index used by BFD. */
addrs->other[i].sectindex = sect->index ;
}
else
@@ -782,13 +719,6 @@ syms_from_objfile (objfile, addrs, mainline, verbo)
CORE_ADDR s_addr = 0;
int i;
- if (strcmp (s->the_bfd_section->name, ".text") == 0)
- s_addr = addrs->text_addr;
- else if (strcmp (s->the_bfd_section->name, ".data") == 0)
- s_addr = addrs->data_addr;
- else if (strcmp (s->the_bfd_section->name, ".bss") == 0)
- s_addr = addrs->bss_addr;
- else
for (i = 0;
!s_addr && i < MAX_SECTIONS && addrs->other[i].name;
i++)
@@ -1615,13 +1545,6 @@ add_symbol_file_command (args, from_tty)
else
addr = strtoul (val, NULL, 10);
- if (strcmp (sec, ".text") == 0)
- section_addrs.text_addr = addr;
- else if (strcmp (sec, ".data") == 0)
- section_addrs.data_addr = addr;
- else if (strcmp (sec, ".bss") == 0)
- section_addrs.bss_addr = addr;
-
/* Here we store the section offsets in the order they were
entered on the command line. */
section_addrs.other[sec_num].name = sec;