From e27d198cc40537237b23d1f34f972d3b2e1c805e Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 8 Apr 2013 20:18:11 +0000 Subject: PR symtab/8424: * blockframe.c (find_pc_partial_function_gnu_ifunc): Check SYMBOL_SECTION, not SYMBOL_OBJ_SECTION. * breakpoint.c (resolve_sal_pc): Update. * elfread.c (elf_gnu_ifunc_record_cache): Update. * findvar.c (struct minsym_lookup_data) : New field. (minsym_lookup_iterator_cb): Use it. (default_read_var_value): Update. * hppa-hpux-tdep.c (hppa64_hpux_in_solib_call_trampoline): Update. * infcmd.c (jump_command): Update. * linespec.c (minsym_found): Update. * maint.c (maintenance_translate_address): Update. * minsyms.c (lookup_minimal_symbol_by_pc_section_1): Update. (prim_record_minimal_symbol_full): Don't set SYMBOL_OBJ_SECTION. * parse.c (write_exp_msymbol): Update. * printcmd.c (address_info): Update. * psymtab.c (find_pc_sect_psymbol): Update. (fixup_psymbol_section): Check SYMBOL_SECTION, not SYMBOL_OBJ_SECTION. (add_psymbol_to_bcache): Correctly initialize SYMBOL_SECTION. Don't initialize SYMBOL_OBJ_SECTION. * spu-tdep.c (spu_catch_start): Update. * stabsread.c (define_symbol): Don't set SYMBOL_SECTION. * symmisc.c (dump_msymbols, print_symbol): Update. * symtab.c (fixup_section): Don't set 'obj_section'. Change how fallback section is computed. (fixup_symbol_section): Update. (find_pc_sect_symtab, find_function_start_sal, skip_prologue_sal): Update. (allocate_symbol, initialize_symbol, allocate_template_symbol): Initialize SYMBOL_SECTION. * symtab.h (struct general_symbol_info)
: Update comment. : Remove. (SYMBOL_OBJ_SECTION): Add 'objfile' argument. Rewrite. (SYMBOL_OBJFILE): New macro. --- gdb/symtab.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'gdb/symtab.h') diff --git a/gdb/symtab.h b/gdb/symtab.h index a1da44b..29a12ff 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -165,16 +165,9 @@ struct general_symbol_info /* Which section is this symbol in? This is an index into section_offsets for this objfile. Negative means that the symbol - does not get relocated relative to a section. - Disclaimer: currently this is just used for xcoff, so don't - expect all symbol-reading code to set it correctly (the ELF code - also tries to set it correctly). */ + does not get relocated relative to a section. */ short section; - - /* The section associated with this symbol. It can be NULL. */ - - struct obj_section *obj_section; }; extern void symbol_set_demangled_name (struct general_symbol_info *, @@ -202,7 +195,10 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *); #define SYMBOL_VALUE_CHAIN(symbol) (symbol)->ginfo.value.chain #define SYMBOL_LANGUAGE(symbol) (symbol)->ginfo.language #define SYMBOL_SECTION(symbol) (symbol)->ginfo.section -#define SYMBOL_OBJ_SECTION(symbol) (symbol)->ginfo.obj_section +#define SYMBOL_OBJ_SECTION(objfile, symbol) \ + (((symbol)->ginfo.section >= 0) \ + ? (&(((objfile)->sections)[(symbol)->ginfo.section])) \ + : NULL) /* Initializes the language dependent portion of a symbol depending upon the language for the symbol. */ @@ -731,6 +727,7 @@ extern const struct symbol_impl *symbol_impls; #define SYMBOL_BLOCK_OPS(symbol) (SYMBOL_IMPL (symbol).ops_block) #define SYMBOL_REGISTER_OPS(symbol) (SYMBOL_IMPL (symbol).ops_register) #define SYMBOL_LOCATION_BATON(symbol) (symbol)->aux_value +#define SYMBOL_OBJFILE(symbol) (SYMBOL_SYMTAB (symbol)->objfile) extern int register_symbol_computed_impl (enum address_class, const struct symbol_computed_ops *); -- cgit v1.1