mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
Remove most calls to fixup_symbol_section
Nearly every call to fixup_symbol_section in gdb is incorrect, and if any such call has an effect, it's purely by happenstance. fixup_section has a long comment explaining that the call should only be made before runtime section offsets are applied. And, the loop in this code (the fallback loop -- the minsym lookup code is "ok") is careful to remove these offsets before comparing addresses. However, aside from a single call in dwarf2/read.c, every call in gdb is actually done after section offsets have been applied. So, these calls are incorrect. Now, these calls could be made when the symbol is created. I considered this approach, but I reasoned that the code has been this way for many years, seemingly without ill effect. So, instead I chose to simply remove the offending calls.
This commit is contained in:
@@ -9210,11 +9210,8 @@ resolve_sal_pc (struct symtab_and_line *sal)
|
||||
{
|
||||
sym = block_linkage_function (b);
|
||||
if (sym != NULL)
|
||||
{
|
||||
fixup_symbol_section (sym, sal->symtab->compunit ()->objfile ());
|
||||
sal->section
|
||||
= sym->obj_section (sal->symtab->compunit ()->objfile ());
|
||||
}
|
||||
sal->section
|
||||
= sym->obj_section (sal->symtab->compunit ()->objfile ());
|
||||
else
|
||||
{
|
||||
/* It really is worthwhile to have the section, so we'll
|
||||
|
||||
Reference in New Issue
Block a user