aboutsummaryrefslogtreecommitdiff
path: root/gdb/buildsym.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-01-13 09:17:27 -0700
committerTom Tromey <tromey@adacore.com>2023-02-08 08:20:12 -0700
commit5abbfa982215a5bcd2bf2c0b92cbb005464dc927 (patch)
tree05b3c8db1334df004607495ec65bee99f05433b5 /gdb/buildsym.c
parentd401e7bf04c0949dcc5e3d83143b75efc19d5f1e (diff)
downloadbinutils-5abbfa982215a5bcd2bf2c0b92cbb005464dc927.zip
binutils-5abbfa982215a5bcd2bf2c0b92cbb005464dc927.tar.gz
binutils-5abbfa982215a5bcd2bf2c0b92cbb005464dc927.tar.bz2
Set section index when setting a symbol's block
When a symbol's block is set, the block has the runtime section offset applied. So, it seems to me that the symbol implicitly is in the same section as the block. Therefore, this patch sets the symbol's section index at this same spot.
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r--gdb/buildsym.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index d82c767..8dbb327 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -245,6 +245,7 @@ buildsym_compunit::finish_block_internal
struct type *ftype = symbol->type ();
struct mdict_iterator miter;
symbol->set_value_block (block);
+ symbol->set_section_index (SECT_OFF_TEXT (m_objfile));
block->set_function (symbol);
if (ftype->num_fields () <= 0)