From e6dc44a8f5a3df8a1799ee1c8a0c7703988923ae Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 8 Apr 2013 20:13:22 +0000 Subject: * coffread.c (record_minimal_symbol): Update. * dbxread.c (record_minimal_symbol): Update. * elfread.c (record_minimal_symbol): Update. * machoread.c (macho_symtab_add_minsym): Update. * mdebugread.c (record_minimal_symbol, parse_partial_symbols): Update. * minsyms.c (prim_record_minimal_symbol): Update. (prim_record_minimal_symbol_full): Remove 'bfd_section' argument. (prim_record_minimal_symbol_and_info): Likewise. * minsyms.h (prim_record_minimal_symbol_full) (prim_record_minimal_symbol_and_info): Update. * symtab.c (allocate_symbol, initialize_symbol) (allocate_template_symbol): Initialize SYMBOL_SECTION. * xcoffread.c (record_minimal_symbol, scan_xcoff_symtab): Update. --- gdb/ChangeLog | 19 +++++++++++++++++++ gdb/coffread.c | 6 +----- gdb/dbxread.c | 13 +------------ gdb/elfread.c | 2 +- gdb/machoread.c | 2 +- gdb/mdebugread.c | 21 ++------------------- gdb/minsyms.c | 19 +++---------------- gdb/minsyms.h | 6 +----- gdb/somread.c | 1 - gdb/xcoffread.c | 10 ++-------- 10 files changed, 31 insertions(+), 68 deletions(-) (limited to 'gdb') diff --git a/gdb/ChangeLog b/gdb/ChangeLog index edc4d0a..11a8cf3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,24 @@ 2013-04-08 Tom Tromey + * coffread.c (record_minimal_symbol): Update. + * dbxread.c (record_minimal_symbol): Update. + * elfread.c (record_minimal_symbol): Update. + * machoread.c (macho_symtab_add_minsym): Update. + * mdebugread.c (record_minimal_symbol, parse_partial_symbols): + Update. + * minsyms.c (prim_record_minimal_symbol): Update. + (prim_record_minimal_symbol_full): Remove 'bfd_section' + argument. + (prim_record_minimal_symbol_and_info): Likewise. + * minsyms.h (prim_record_minimal_symbol_full) + (prim_record_minimal_symbol_and_info): Update. + * symtab.c (allocate_symbol, initialize_symbol) + (allocate_template_symbol): Initialize SYMBOL_SECTION. + * xcoffread.c (record_minimal_symbol, scan_xcoff_symtab): + Update. + +2013-04-08 Tom Tromey + PR symtab/8423: * solib-som.c (som_solib_section_offsets): Use BFD section indices. Set offsets for all sections. diff --git a/gdb/coffread.c b/gdb/coffread.c index 9076262..bf39085 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -456,8 +456,6 @@ record_minimal_symbol (struct coff_symbol *cs, CORE_ADDR address, enum minimal_symbol_type type, int section, struct objfile *objfile) { - struct bfd_section *bfd_section; - /* We don't want TDESC entry points in the minimal symbol table. */ if (cs->c_name[0] == '@') return NULL; @@ -472,10 +470,8 @@ record_minimal_symbol (struct coff_symbol *cs, CORE_ADDR address, return NULL; } - bfd_section = cs_to_bfd_section (cs, objfile); return prim_record_minimal_symbol_and_info (cs->c_name, address, - type, section, - bfd_section, objfile); + type, section, objfile); } /* coff_symfile_init () diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 435c518..01dc1bf 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -440,35 +440,29 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type, { enum minimal_symbol_type ms_type; int section; - asection *bfd_section; switch (type) { case N_TEXT | N_EXT: ms_type = mst_text; section = SECT_OFF_TEXT (objfile); - bfd_section = DBX_TEXT_SECTION (objfile); break; case N_DATA | N_EXT: ms_type = mst_data; section = SECT_OFF_DATA (objfile); - bfd_section = DBX_DATA_SECTION (objfile); break; case N_BSS | N_EXT: ms_type = mst_bss; section = SECT_OFF_BSS (objfile); - bfd_section = DBX_BSS_SECTION (objfile); break; case N_ABS | N_EXT: ms_type = mst_abs; section = -1; - bfd_section = NULL; break; #ifdef N_SETV case N_SETV | N_EXT: ms_type = mst_data; section = SECT_OFF_DATA (objfile); - bfd_section = DBX_DATA_SECTION (objfile); break; case N_SETV: /* I don't think this type actually exists; since a N_SETV is the result @@ -476,7 +470,6 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type, file local. */ ms_type = mst_file_data; section = SECT_OFF_DATA (objfile); - bfd_section = DBX_DATA_SECTION (objfile); break; #endif case N_TEXT: @@ -485,7 +478,6 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type, case N_FN_SEQ: ms_type = mst_file_text; section = SECT_OFF_TEXT (objfile); - bfd_section = DBX_TEXT_SECTION (objfile); break; case N_DATA: ms_type = mst_file_data; @@ -507,17 +499,14 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type, ms_type = mst_data; } section = SECT_OFF_DATA (objfile); - bfd_section = DBX_DATA_SECTION (objfile); break; case N_BSS: ms_type = mst_file_bss; section = SECT_OFF_BSS (objfile); - bfd_section = DBX_BSS_SECTION (objfile); break; default: ms_type = mst_unknown; section = -1; - bfd_section = NULL; break; } @@ -526,7 +515,7 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type, lowest_text_address = address; prim_record_minimal_symbol_and_info - (name, address, ms_type, section, bfd_section, objfile); + (name, address, ms_type, section, objfile); } /* Scan and build partial symbols for a symbol file. diff --git a/gdb/elfread.c b/gdb/elfread.c index 668b974..b92ba16 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -211,7 +211,7 @@ record_minimal_symbol (const char *name, int name_len, int copy_name, ms_type, gdb_bfd_section_index (objfile->obfd, bfd_section), - bfd_section, objfile); + objfile); } /* Read the symbol table of an ELF file. diff --git a/gdb/machoread.c b/gdb/machoread.c index 54d8e31..18cd04a 100644 --- a/gdb/machoread.c +++ b/gdb/machoread.c @@ -167,7 +167,7 @@ macho_symtab_add_minsym (struct objfile *objfile, const asymbol *sym) prim_record_minimal_symbol_and_info (sym->name, symaddr, ms_type, gdb_bfd_section_index (objfile->obfd, sym->section), - sym->section, objfile); + objfile); } } diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index d922207..5549610 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -2256,74 +2256,59 @@ record_minimal_symbol (const char *name, const CORE_ADDR address, struct objfile *objfile) { int section; - asection *bfd_section; switch (storage_class) { case scText: section = SECT_OFF_TEXT (objfile); - bfd_section = bfd_get_section_by_name (cur_bfd, ".text"); break; case scData: section = SECT_OFF_DATA (objfile); - bfd_section = bfd_get_section_by_name (cur_bfd, ".data"); break; case scBss: section = SECT_OFF_BSS (objfile); - bfd_section = bfd_get_section_by_name (cur_bfd, ".bss"); break; case scSData: section = get_section_index (objfile, ".sdata"); - bfd_section = bfd_get_section_by_name (cur_bfd, ".sdata"); break; case scSBss: section = get_section_index (objfile, ".sbss"); - bfd_section = bfd_get_section_by_name (cur_bfd, ".sbss"); break; case scRData: section = get_section_index (objfile, ".rdata"); - bfd_section = bfd_get_section_by_name (cur_bfd, ".rdata"); break; case scInit: section = get_section_index (objfile, ".init"); - bfd_section = bfd_get_section_by_name (cur_bfd, ".init"); break; case scXData: section = get_section_index (objfile, ".xdata"); - bfd_section = bfd_get_section_by_name (cur_bfd, ".xdata"); break; case scPData: section = get_section_index (objfile, ".pdata"); - bfd_section = bfd_get_section_by_name (cur_bfd, ".pdata"); break; case scFini: section = get_section_index (objfile, ".fini"); - bfd_section = bfd_get_section_by_name (cur_bfd, ".fini"); break; case scRConst: section = get_section_index (objfile, ".rconst"); - bfd_section = bfd_get_section_by_name (cur_bfd, ".rconst"); break; #ifdef scTlsData case scTlsData: section = get_section_index (objfile, ".tlsdata"); - bfd_section = bfd_get_section_by_name (cur_bfd, ".tlsdata"); break; #endif #ifdef scTlsBss case scTlsBss: section = get_section_index (objfile, ".tlsbss"); - bfd_section = bfd_get_section_by_name (cur_bfd, ".tlsbss"); break; #endif default: /* This kind of symbol is not associated to a section. */ section = -1; - bfd_section = NULL; } prim_record_minimal_symbol_and_info (name, address, ms_type, - section, bfd_section, objfile); + section, objfile); } /* Master parsing procedure for first-pass reading of file symbols @@ -3510,7 +3495,7 @@ parse_partial_symbols (struct objfile *objfile) prim_record_minimal_symbol_and_info (name, sh.value, mst_file_text, SECT_OFF_TEXT (objfile), - NULL, objfile); + objfile); /* FALLTHROUGH */ @@ -3596,13 +3581,11 @@ parse_partial_symbols (struct objfile *objfile) prim_record_minimal_symbol_and_info (name, sh.value, mst_file_data, SECT_OFF_DATA (objfile), - NULL, objfile); else prim_record_minimal_symbol_and_info (name, sh.value, mst_file_bss, SECT_OFF_BSS (objfile), - NULL, objfile); class = LOC_STATIC; break; diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 6a94e11..396b063 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -892,7 +892,7 @@ prim_record_minimal_symbol (const char *name, CORE_ADDR address, } prim_record_minimal_symbol_and_info (name, address, ms_type, - section, NULL, objfile); + section, objfile); } /* See minsyms.h. */ @@ -902,7 +902,6 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name, CORE_ADDR address, enum minimal_symbol_type ms_type, int section, - asection *bfd_section, struct objfile *objfile) { struct obj_section *obj_section; @@ -945,17 +944,6 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name, SYMBOL_SECTION (msymbol) = section; SYMBOL_OBJ_SECTION (msymbol) = NULL; - /* Find obj_section corresponding to bfd_section. */ - if (bfd_section) - ALL_OBJFILE_OSECTIONS (objfile, obj_section) - { - if (obj_section->the_bfd_section == bfd_section) - { - SYMBOL_OBJ_SECTION (msymbol) = obj_section; - break; - } - } - MSYMBOL_TYPE (msymbol) = ms_type; MSYMBOL_TARGET_FLAG_1 (msymbol) = 0; MSYMBOL_TARGET_FLAG_2 (msymbol) = 0; @@ -980,12 +968,11 @@ struct minimal_symbol * prim_record_minimal_symbol_and_info (const char *name, CORE_ADDR address, enum minimal_symbol_type ms_type, int section, - asection *bfd_section, struct objfile *objfile) { return prim_record_minimal_symbol_full (name, strlen (name), 1, - address, ms_type, section, - bfd_section, objfile); + address, ms_type, + section, objfile); } /* Compare two minimal symbols by address and return a signed result based diff --git a/gdb/minsyms.h b/gdb/minsyms.h index 71670e3..4d48477 100644 --- a/gdb/minsyms.h +++ b/gdb/minsyms.h @@ -88,7 +88,6 @@ struct cleanup *make_cleanup_discard_minimal_symbols (void); ADDRESS - the address of the symbol MS_TYPE - the type of the symbol SECTION - the symbol's section - BFD_SECTION - the symbol's BFD section; used to find the appropriate obj_section for the minimal symbol. This can be NULL. OBJFILE - the objfile associated with the minimal symbol. */ @@ -99,14 +98,12 @@ struct minimal_symbol *prim_record_minimal_symbol_full CORE_ADDR address, enum minimal_symbol_type ms_type, int section, - asection *bfd_section, struct objfile *objfile); /* Like prim_record_minimal_symbol_full, but: - uses strlen to compute NAME_LEN, - passes COPY_NAME = 0, - - passes SECTION = 0, - - and passes BFD_SECTION = NULL. + - and passes a default SECTION, depending on the type This variant does not return the new symbol. */ @@ -123,7 +120,6 @@ struct minimal_symbol *prim_record_minimal_symbol_and_info CORE_ADDR, enum minimal_symbol_type, int section, - asection *bfd_section, struct objfile *); /* Install the minimal symbols that have been collected into the given diff --git a/gdb/somread.c b/gdb/somread.c index 44b0c85..7772f9f 100644 --- a/gdb/somread.c +++ b/gdb/somread.c @@ -314,7 +314,6 @@ som_symtab_read (bfd *abfd, struct objfile *objfile, prim_record_minimal_symbol_and_info (symname, symbol_value, ms_type, gdb_bfd_section_index (objfile->obfd, section), - section, objfile); } } diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index e6a562d..6013551 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -922,15 +922,12 @@ record_minimal_symbol (const char *name, CORE_ADDR address, int n_scnum, struct objfile *objfile) { - int secnum; - asection *bfd_sect; - if (name[0] == '.') ++name; - xcoff_secnum_to_sections (n_scnum, objfile, &bfd_sect, &secnum); prim_record_minimal_symbol_and_info (name, address, ms_type, - secnum, bfd_sect, objfile); + secnum_to_section (n_scnum, objfile), + objfile); } /* xcoff has static blocks marked in `.bs', `.es' pairs. They cannot be @@ -2346,7 +2343,6 @@ scan_xcoff_symtab (struct objfile *objfile) (namestring, symbol.n_value, sclass == C_HIDEXT ? mst_file_data : mst_data, secnum_to_section (symbol.n_scnum, objfile), - secnum_to_bfd_section (symbol.n_scnum, objfile), objfile); break; @@ -2424,7 +2420,6 @@ scan_xcoff_symtab (struct objfile *objfile) (namestring, symbol.n_value, sclass == C_HIDEXT ? mst_file_data : mst_data, secnum_to_section (symbol.n_scnum, objfile), - secnum_to_bfd_section (symbol.n_scnum, objfile), objfile); break; } @@ -2442,7 +2437,6 @@ scan_xcoff_symtab (struct objfile *objfile) (namestring, symbol.n_value, sclass == C_HIDEXT ? mst_file_bss : mst_bss, secnum_to_section (symbol.n_scnum, objfile), - secnum_to_bfd_section (symbol.n_scnum, objfile), objfile); break; } -- cgit v1.1