ppc/svp64: reuse md_parse_name in md_operand
[binutils-gdb.git] / bfd / coff-bfd.c
index 6e15bdc71631045d571d99a6232fa13d201e85ef..2152bec182fed7d563d8dc2b5cd1ad4b8a5b509f 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD COFF interfaces used outside of BFD.
-   Copyright (C) 1990-2021 Free Software Foundation, Inc.
+   Copyright (C) 1990-2022 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -27,7 +27,7 @@
 
 /* Return the COFF syment for a symbol.  */
 
-bfd_boolean
+bool
 bfd_coff_get_syment (bfd *abfd,
                     asymbol *symbol,
                     struct internal_syment *psyment)
@@ -39,23 +39,24 @@ bfd_coff_get_syment (bfd *abfd,
       || ! csym->native->is_sym)
     {
       bfd_set_error (bfd_error_invalid_operation);
-      return FALSE;
+      return false;
     }
 
   *psyment = csym->native->u.syment;
 
   if (csym->native->fix_value)
-    psyment->n_value = psyment->n_value -
-      (bfd_hostptr_t) obj_raw_syments (abfd);
+    psyment->n_value =
+      ((psyment->n_value - (uintptr_t) obj_raw_syments (abfd))
+       / sizeof (combined_entry_type));
 
   /* FIXME: We should handle fix_line here.  */
 
-  return TRUE;
+  return true;
 }
 
 /* Return the COFF auxent for a symbol.  */
 
-bfd_boolean
+bool
 bfd_coff_get_auxent (bfd *abfd,
                     asymbol *symbol,
                     int indx,
@@ -72,7 +73,7 @@ bfd_coff_get_auxent (bfd *abfd,
       || indx >= csym->native->u.syment.n_numaux)
     {
       bfd_set_error (bfd_error_invalid_operation);
-      return FALSE;
+      return false;
     }
 
   ent = csym->native + indx + 1;
@@ -95,5 +96,5 @@ bfd_coff_get_auxent (bfd *abfd,
       ((combined_entry_type *) pauxent->x_csect.x_scnlen.p
        - obj_raw_syments (abfd));
 
-  return TRUE;
+  return true;
 }