From 2273f0ac95a79ce29ef42025c63f90e82cf907d7 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 15 Oct 2013 13:28:57 -0600 Subject: change minsyms not to be relocated at read-time This removes the runtime offsets from minsyms. Instead, these offsets will now be applied whenever the minsym's address is computed. This patch redefines MSYMBOL_VALUE_ADDRESS to actually use the offsets from the given objfile. Then, it updates all the symbol readers, changing them so that they do not add in the section offset when creating the symbol. This change also lets us remove relocation of minsyms from objfile_relocate1 and also msymbols_sort. 2014-02-26 Tom Tromey * minsyms.c (msymbols_sort): Remove. * minsyms.h (msymbols_sort): Remove. * objfiles.c (objfile_relocate1): Don't relocate minsyms. * symtab.h (MSYMBOL_VALUE_ADDRESS): Use objfile offsets. * elfread.c (elf_symtab_read): Don't add section offsets. * xcoffread.c (record_minimal_symbol): Don't add section offset to minimal symbol address. * somread.c (text_offset, data_offset): Remove. (som_symtab_read): Don't add section offsets to minimal symbol addresses. * coff-pe-read.c (add_pe_forwarded_sym, read_pe_exported_syms): Don't add section offsets to minimal symbols. * coffread.c (coff_symtab_read): Don't add section offsets to minimal symbol addresses. * machoread.c (macho_symtab_add_minsym): Don't add section offset to minimal symbol addresses. * mipsread.c (read_alphacoff_dynamic_symtab): Don't add section offset to minimal symbol addresses. * mdebugread.c (parse_partial_symbols): Don't add section offset to minimal symbol addresses. * dbxread.c (read_dbx_dynamic_symtab): Don't add section offset to minimal symbol addresses. --- gdb/objfiles.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'gdb/objfiles.c') diff --git a/gdb/objfiles.c b/gdb/objfiles.c index db0c720..f456569 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -801,19 +801,6 @@ objfile_relocate1 (struct objfile *objfile, objfile->sf->qf->relocate (objfile, new_offsets, delta); { - struct minimal_symbol *msym; - - ALL_OBJFILE_MSYMBOLS (objfile, msym) - if (MSYMBOL_SECTION (msym) >= 0) - SET_MSYMBOL_VALUE_ADDRESS (msym, (MSYMBOL_VALUE_ADDRESS (objfile, msym) - + ANOFFSET (delta, - MSYMBOL_SECTION (msym)))); - } - /* Relocating different sections by different amounts may cause the symbols - to be out of order. */ - msymbols_sort (objfile); - - { int i; for (i = 0; i < objfile->num_sections; ++i) -- cgit v1.1