In new_symbol(), relocate symbol address by base address of the section
it is in instead of using the base address of the .text section.
This commit is contained in:
parent
4930751aae
commit
a275699e3a
|
@ -1,3 +1,9 @@
|
||||||
|
2000-11-03 Kevin Buettner <kevinb@redhat.com>
|
||||||
|
|
||||||
|
* dwarf2read.c (new_symbol): Relocate address of symbol by the
|
||||||
|
base address of the section it is in rather than always using
|
||||||
|
the base address of the .text section.
|
||||||
|
|
||||||
2000-11-01 J.T. Conklin <jtc@redback.com>
|
2000-11-01 J.T. Conklin <jtc@redback.com>
|
||||||
|
|
||||||
* TODO: Note abstraction layer violation where "ocd reset" command
|
* TODO: Note abstraction layer violation where "ocd reset" command
|
||||||
|
|
|
@ -4185,7 +4185,10 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
|
||||||
the variable is referenced. */
|
the variable is referenced. */
|
||||||
if (SYMBOL_VALUE_ADDRESS (sym))
|
if (SYMBOL_VALUE_ADDRESS (sym))
|
||||||
{
|
{
|
||||||
SYMBOL_VALUE_ADDRESS (sym) += baseaddr;
|
fixup_symbol_section (sym, objfile);
|
||||||
|
SYMBOL_VALUE_ADDRESS (sym) +=
|
||||||
|
ANOFFSET (objfile->section_offsets,
|
||||||
|
SYMBOL_SECTION (sym));
|
||||||
SYMBOL_CLASS (sym) = LOC_STATIC;
|
SYMBOL_CLASS (sym) = LOC_STATIC;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -4215,8 +4218,11 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
fixup_symbol_section (sym, objfile);
|
||||||
|
SYMBOL_VALUE_ADDRESS (sym) =
|
||||||
|
addr + ANOFFSET (objfile->section_offsets,
|
||||||
|
SYMBOL_SECTION (sym));
|
||||||
SYMBOL_CLASS (sym) = LOC_STATIC;
|
SYMBOL_CLASS (sym) = LOC_STATIC;
|
||||||
SYMBOL_VALUE_ADDRESS (sym) = addr + baseaddr;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue