diff options
author | Tom Tromey <tromey@redhat.com> | 2013-10-15 13:28:57 -0600 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2014-02-26 12:11:17 -0700 |
commit | 2273f0ac95a79ce29ef42025c63f90e82cf907d7 (patch) | |
tree | 11a8d5d14c815bc74dacecdc0374fb082512ab13 /gdb/machoread.c | |
parent | 77e371c079408e265f1dfd2b0620dd8e76c23371 (diff) | |
download | gdb-2273f0ac95a79ce29ef42025c63f90e82cf907d7.zip gdb-2273f0ac95a79ce29ef42025c63f90e82cf907d7.tar.gz gdb-2273f0ac95a79ce29ef42025c63f90e82cf907d7.tar.bz2 |
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 <tromey@redhat.com>
* 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.
Diffstat (limited to 'gdb/machoread.c')
-rw-r--r-- | gdb/machoread.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/gdb/machoread.c b/gdb/machoread.c index f7194e2..f5e4a1e 100644 --- a/gdb/machoread.c +++ b/gdb/machoread.c @@ -111,24 +111,11 @@ macho_symtab_add_minsym (struct objfile *objfile, const asymbol *sym) if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK)) { CORE_ADDR symaddr; - CORE_ADDR offset; enum minimal_symbol_type ms_type; - offset = ANOFFSET (objfile->section_offsets, - gdb_bfd_section_index (objfile->obfd, sym->section)); - /* Bfd symbols are section relative. */ symaddr = sym->value + sym->section->vma; - /* Select global/local/weak symbols. Note that bfd puts abs - symbols in their own section, so all symbols we are - interested in will have a section. */ - /* Relocate all non-absolute and non-TLS symbols by the - section offset. */ - if (sym->section != bfd_abs_section_ptr - && !(sym->section->flags & SEC_THREAD_LOCAL)) - symaddr += offset; - if (sym->section == bfd_abs_section_ptr) ms_type = mst_abs; else if (sym->section->flags & SEC_CODE) |