[binutils-gdb] gprof: rename min_insn_size to insn_boundary

Alan Modra amodra@sourceware.org
Sat Mar 1 00:47:48 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f19534f257eb2643624414c22aa5a32da39d7b66

commit f19534f257eb2643624414c22aa5a32da39d7b66
Author: Richard Allen <rsaxvc@gmail.com>
Date:   Sun Feb 16 16:50:01 2025 -0600

    gprof: rename min_insn_size to insn_boundary
    
    This distinction is important for architecures like Xtensa,
    where 2B and 3B instructions are common, but the correct
    value for instruction iteration is 1B, not 2B.
    
    Signed-off-by: Richard Allen <rsaxvc@gmail.com>

Diff:
---
 gprof/corefile.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/gprof/corefile.c b/gprof/corefile.c
index 65d8ccf5476..bd8e60d4e68 100644
--- a/gprof/corefile.c
+++ b/gprof/corefile.c
@@ -36,7 +36,8 @@ static asymbol **core_syms;
 asection *core_text_sect;
 void * core_text_space;
 
-static int min_insn_size;
+/* Greatest common divisor of instruction sizes and alignments.  */
+static int insn_boundary;
 int offset_to_code;
 
 /* For mapping symbols to specific .o files during file ordering.  */
@@ -245,7 +246,7 @@ core_init (const char * aout_name)
       *symp = 0;
     }
 
-  min_insn_size = 1;
+  insn_boundary = 1;
   offset_to_code = 0;
 
   switch (bfd_get_arch (core_bfd))
@@ -255,7 +256,7 @@ core_init (const char * aout_name)
       break;
 
     case bfd_arch_alpha:
-      min_insn_size = 4;
+      insn_boundary = 4;
       break;
 
     default:
@@ -791,7 +792,7 @@ core_create_line_syms (void)
   prev_line_num = 0;
 
   vma_high = core_text_sect->vma + bfd_section_size (core_text_sect);
-  for (vma = core_text_sect->vma; vma < vma_high; vma += min_insn_size)
+  for (vma = core_text_sect->vma; vma < vma_high; vma += insn_boundary)
     {
       unsigned int len;
 
@@ -857,7 +858,7 @@ core_create_line_syms (void)
      lot cleaner now.  */
   prev = 0;
 
-  for (vma = core_text_sect->vma; vma < vma_high; vma += min_insn_size)
+  for (vma = core_text_sect->vma; vma < vma_high; vma += insn_boundary)
     {
       sym_init (ltab.limit);


More information about the Binutils-cvs mailing list