From 62fad389f2133d5d50dfdf78552cc1b08b30af92 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Wed, 26 Oct 1994 21:50:19 +0000 Subject: [PATCH] * 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. --- gdb/ChangeLog | 7 ++++++ gdb/coffread.c | 60 +++++++++++++++++++++++++++++++++----------------- 2 files changed, 47 insertions(+), 20 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a916c6cf461..1245a7add4d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +Wed Oct 26 12:20:53 1994 Jim Kingdon + + * 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 ddd05117beb..c4f06e14d23 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: -- 2.30.2