aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-01-13 09:27:54 -0700
committerTom Tromey <tromey@adacore.com>2023-02-08 08:20:12 -0700
commitdae58e04442670270fe116ff1f2e38a2b184b4a1 (patch)
tree04e2d5d13c4f771bb1d717c322aa48f76b4e3376 /gdb/objfiles.c
parent5abbfa982215a5bcd2bf2c0b92cbb005464dc927 (diff)
downloadgdb-dae58e04442670270fe116ff1f2e38a2b184b4a1.zip
gdb-dae58e04442670270fe116ff1f2e38a2b184b4a1.tar.gz
gdb-dae58e04442670270fe116ff1f2e38a2b184b4a1.tar.bz2
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.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index bf5057e..ed29131 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -582,8 +582,6 @@ static void
relocate_one_symbol (struct symbol *sym, struct objfile *objfile,
const section_offsets &delta)
{
- fixup_symbol_section (sym, objfile);
-
/* The RS6000 code from which this was taken skipped
any symbols in STRUCT_DOMAIN or UNDEF_DOMAIN.
But I'm leaving out that test, on the theory that