[4/6] Set section index when setting a symbol's block

Message ID 20230118153025.342512-5-tromey@adacore.com
State New
Headers
Series Change how symbol section indices are set |

Commit Message

Tom Tromey Jan. 18, 2023, 3:30 p.m. UTC
  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.
---
 gdb/buildsym.c | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 8c61223b1a0..fa55699b40e 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -247,6 +247,7 @@  buildsym_compunit::finish_block_internal
       struct type *ftype = symbol->type ();
       struct mdict_iterator miter;
       symbol->set_value_block (block);
+      symbol->set_section_index (m_section_index);
       block->set_function (symbol);
 
       if (ftype->num_fields () <= 0)