aboutsummaryrefslogtreecommitdiff
path: root/gdb/dbxread.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-10-15 13:28:57 -0600
committerTom Tromey <tromey@redhat.com>2014-02-26 12:11:17 -0700
commit2273f0ac95a79ce29ef42025c63f90e82cf907d7 (patch)
tree11a8d5d14c815bc74dacecdc0374fb082512ab13 /gdb/dbxread.c
parent77e371c079408e265f1dfd2b0620dd8e76c23371 (diff)
downloadgdb-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/dbxread.c')
-rw-r--r--gdb/dbxread.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index e0e5c48..5171f50 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -1045,20 +1045,14 @@ read_dbx_dynamic_symtab (struct objfile *objfile)
if (bfd_get_section_flags (abfd, sec) & SEC_CODE)
{
- sym_value += ANOFFSET (objfile->section_offsets,
- SECT_OFF_TEXT (objfile));
type = N_TEXT;
}
else if (bfd_get_section_flags (abfd, sec) & SEC_DATA)
{
- sym_value += ANOFFSET (objfile->section_offsets,
- SECT_OFF_DATA (objfile));
type = N_DATA;
}
else if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
{
- sym_value += ANOFFSET (objfile->section_offsets,
- SECT_OFF_BSS (objfile));
type = N_BSS;
}
else
@@ -1098,9 +1092,7 @@ read_dbx_dynamic_symtab (struct objfile *objfile)
counter++, relptr++)
{
arelent *rel = *relptr;
- CORE_ADDR address =
- rel->address + ANOFFSET (objfile->section_offsets,
- SECT_OFF_DATA (objfile));
+ CORE_ADDR address = rel->address;
switch (bfd_get_arch (abfd))
{
@@ -1326,22 +1318,16 @@ read_dbx_symtab (struct objfile *objfile)
case N_TEXT | N_EXT:
case N_NBTEXT | N_EXT:
- nlist.n_value += ANOFFSET (objfile->section_offsets,
- SECT_OFF_TEXT (objfile));
goto record_it;
case N_DATA | N_EXT:
case N_NBDATA | N_EXT:
- nlist.n_value += ANOFFSET (objfile->section_offsets,
- SECT_OFF_DATA (objfile));
goto record_it;
case N_BSS:
case N_BSS | N_EXT:
case N_NBBSS | N_EXT:
case N_SETV | N_EXT: /* FIXME, is this in BSS? */
- nlist.n_value += ANOFFSET (objfile->section_offsets,
- SECT_OFF_BSS (objfile));
goto record_it;
case N_ABS | N_EXT:
@@ -1364,14 +1350,15 @@ read_dbx_symtab (struct objfile *objfile)
case N_FN:
case N_FN_SEQ:
case N_TEXT:
- nlist.n_value += ANOFFSET (objfile->section_offsets,
- SECT_OFF_TEXT (objfile));
namestring = set_namestring (objfile, &nlist);
if ((namestring[0] == '-' && namestring[1] == 'l')
|| (namestring[(nsl = strlen (namestring)) - 1] == 'o'
&& namestring[nsl - 2] == '.'))
{
+ nlist.n_value += ANOFFSET (objfile->section_offsets,
+ SECT_OFF_TEXT (objfile));
+
if (past_first_source_file && pst
/* The gould NP1 uses low values for .o and -l symbols
which are not the address. */
@@ -1396,8 +1383,6 @@ read_dbx_symtab (struct objfile *objfile)
continue;
case N_DATA:
- nlist.n_value += ANOFFSET (objfile->section_offsets,
- SECT_OFF_DATA (objfile));
goto record_it;
case N_UNDF | N_EXT: