Index: coffread.c =================================================================== RCS file: /cvs/src/src/gdb/coffread.c,v retrieving revision 1.63 diff -u -p -r1.63 coffread.c --- coffread.c 17 Dec 2005 22:33:59 -0000 1.63 +++ coffread.c 17 Nov 2006 00:45:46 -0000 @@ -284,6 +284,19 @@ cs_to_section (struct coff_symbol *cs, s return off; } +/* Return the bfd_section that CS points to. */ +static struct bfd_section* +cs_to_bfd_section (struct coff_symbol *cs, struct objfile *objfile) +{ + asection *sect = NULL; + struct find_targ_sec_arg args; + + args.targ_index = cs->c_secnum; + args.resultp = § + bfd_map_over_sections (objfile->obfd, find_targ_sec, &args); + return sect; +} + /* Return the address of the section of a COFF symbol. */ static CORE_ADDR cs_section_address (struct coff_symbol *, bfd *); @@ -926,9 +939,10 @@ coff_symtab_read (long symtab_offset, un if (cs->c_name[0] != '@' /* Skip tdesc symbols */ ) { struct minimal_symbol *msym; + struct bfd_section *bfd_section = cs_to_bfd_section (cs, objfile); msym = prim_record_minimal_symbol_and_info (cs->c_name, tmpaddr, ms_type, NULL, - sec, NULL, objfile); + sec, bfd_section, objfile); if (msym) COFF_MAKE_MSYMBOL_SPECIAL (cs->c_sclass, msym); }