[binutils-gdb] Change is_import_fixup_symbol to return bool

Tom Tromey tromey@sourceware.org
Tue Jan 20 15:53:03 GMT 2026


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

commit 01be62d46b2e05e5a994b080974dd3832755e137
Author: Tom Tromey <tromey@adacore.com>
Date:   Fri Jan 16 11:28:30 2026 -0700

    Change is_import_fixup_symbol to return bool
    
    This changes the is_import_fixup_symbol in coffread.c to return bool
    rather than int.
    
    Approved-By: Simon Marchi <simon.marchi@efficios.com>

Diff:
---
 gdb/coffread.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/gdb/coffread.c b/gdb/coffread.c
index 54d6c0f4469..f45b5efd5b3 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -95,7 +95,7 @@ private:
   asection *cs_to_bfd_section (coff_symbol *cs);
   int cs_to_section (coff_symbol *cs);
   CORE_ADDR cs_section_address (coff_symbol *cs);
-  int is_import_fixup_symbol (coff_symbol *cs, minimal_symbol_type type);
+  bool is_import_fixup_symbol (coff_symbol *cs, minimal_symbol_type type);
   minimal_symbol *record_minimal_symbol (minimal_symbol_reader &reader,
 					 coff_symbol *cs,
 					 unrelocated_addr address,
@@ -148,9 +148,9 @@ coff_reader::cs_section_address (struct coff_symbol *cs)
 
 /* The linker sometimes generates some non-function symbols inside
    functions referencing variables imported from another DLL.
-   Return nonzero if the given symbol corresponds to one of them.  */
+   Return true if the given symbol corresponds to one of them.  */
 
-int
+bool
 coff_reader::is_import_fixup_symbol (struct coff_symbol *cs,
 				     enum minimal_symbol_type type)
 {
@@ -160,23 +160,23 @@ coff_reader::is_import_fixup_symbol (struct coff_symbol *cs,
 
   /* Must be a non-static text symbol.  */
   if (type != mst_text)
-    return 0;
+    return false;
 
   /* Must be a non-function symbol.  */
   if (ISFCN (cs->c_type))
-    return 0;
+    return false;
 
   /* The name must start with "__fu<digits>__".  */
   if (!startswith (cs->c_name, "__fu"))
-    return 0;
+    return false;
   if (! c_isdigit (cs->c_name[4]))
-    return 0;
+    return false;
   for (i = 5; cs->c_name[i] != '\0' && c_isdigit (cs->c_name[i]); i++)
     /* Nothing, just incrementing index past all digits.  */;
   if (cs->c_name[i] != '_' || cs->c_name[i + 1] != '_')
-    return 0;
+    return false;
 
-  return 1;
+  return true;
 }
 
 struct minimal_symbol *


More information about the Gdb-cvs mailing list