From: Tom Tromey Date: Fri, 13 Jan 2023 16:17:27 +0000 (-0700) Subject: Set section index when setting a symbol's block X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5abbfa982215a5bcd2bf2c0b92cbb005464dc927;p=binutils-gdb.git 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. --- diff --git a/gdb/buildsym.c b/gdb/buildsym.c index d82c7672f7c..8dbb327f0eb 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)