aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1994-10-26 21:50:19 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1994-10-26 21:50:19 +0000
commit62fad389f2133d5d50dfdf78552cc1b08b30af92 (patch)
tree19d651b146861aa50f80ea5421a2be0066ff7c37
parent32286e08a514fa23565a7ccf76957e41806ea203 (diff)
downloadgdb-62fad389f2133d5d50dfdf78552cc1b08b30af92.zip
gdb-62fad389f2133d5d50dfdf78552cc1b08b30af92.tar.gz
gdb-62fad389f2133d5d50dfdf78552cc1b08b30af92.tar.bz2
* coffread.c (coff_symtab_read): If we get the address from
target_lookup_symbol, set the section to -2 not SECT_OFF_BSS. (coff_symtab_read): Set value and section of symbol that process_coff_symbol returns.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/coffread.c60
2 files changed, 47 insertions, 20 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a916c6c..1245a7a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+Wed Oct 26 12:20:53 1994 Jim Kingdon <kingdon@cygnus.com>
+
+ * coffread.c (coff_symtab_read): If we get the address from
+ target_lookup_symbol, set the section to -2 not SECT_OFF_BSS.
+ (coff_symtab_read): Set value and section of symbol that
+ process_coff_symbol returns.
+
Tue Oct 25 09:53:04 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
* config/i386/tm-nbsd.h: Enable longjmp support.
diff --git a/gdb/coffread.c b/gdb/coffread.c
index ddd0511..c4f06e1 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -922,7 +922,10 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
break;
}
tmpaddr = reladdr;
- sec = SECT_OFF_BSS;
+ /* The address has already been relocated; make sure that
+ objfile_relocate doesn't relocate it again. */
+ sec = -2;
+ ms_type = cs->c_sclass == C_STAT ? mst_file_bss : mst_bss;
}
else
{
@@ -930,30 +933,47 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
tmpaddr = cs->c_value;
if (cs->c_sclass != C_STAT)
tmpaddr += ANOFFSET (section_offsets, sec);
+
+ switch (sec)
+ {
+ case SECT_OFF_TEXT:
+ case SECT_OFF_RODATA:
+ ms_type =
+ cs->c_sclass == C_STAT ? mst_file_text : mst_text;
+ break;
+ case SECT_OFF_DATA:
+ ms_type =
+ cs->c_sclass == C_STAT ? mst_file_data : mst_data;
+ break;
+ case SECT_OFF_BSS:
+ ms_type =
+ cs->c_sclass == C_STAT ? mst_file_bss : mst_bss;
+ break;
+ default:
+ ms_type = mst_unknown;
+ break;
+ }
}
- switch (sec)
+ if (cs->c_name[0] != '@' /* Skip tdesc symbols */)
+ prim_record_minimal_symbol_and_info
+ (obsavestring (cs->c_name, strlen (cs->c_name),
+ &objfile->symbol_obstack),
+ tmpaddr,
+ ms_type,
+ NULL,
+ sec,
+ objfile);
+
+ if (SDB_TYPE (cs->c_type))
{
- case SECT_OFF_TEXT:
- case SECT_OFF_RODATA:
- ms_type = cs->c_sclass == C_STAT ? mst_file_text : mst_text;
- break;
- case SECT_OFF_DATA:
- ms_type = cs->c_sclass == C_STAT ? mst_file_data : mst_data;
- break;
- case SECT_OFF_BSS:
- ms_type = cs->c_sclass == C_STAT ? mst_file_bss : mst_bss;
- break;
- default:
- ms_type = mst_unknown;
- break;
+ struct symbol *sym;
+ sym = process_coff_symbol
+ (cs, &main_aux, section_offsets, objfile);
+ SYMBOL_VALUE (sym) = tmpaddr;
+ SYMBOL_SECTION (sym) = sec;
}
-
- record_minimal_symbol (cs->c_name, tmpaddr, ms_type, objfile);
}
-
- if (SDB_TYPE (cs->c_type))
- process_coff_symbol (cs, &main_aux, section_offsets, objfile);
break;
case C_FCN: