]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
elfxx-aarch64.c: Replace nested function with a static inline version instead.
authorNick Clifton <nickc@redhat.com>
Wed, 5 Mar 2025 10:45:35 +0000 (10:45 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 5 Mar 2025 10:45:35 +0000 (10:45 +0000)
bfd/elfxx-aarch64.c

index 317052071dbd85c9ab906804d0bf0c66db79cc0b..45a02058e814a572d82f65409dac53bc01cf55b3 100644 (file)
@@ -704,6 +704,18 @@ typedef struct
   asection* sec;
 } bfd_search_result_t;
 
+static inline bool
+bfd_is_non_dynamic_elf_object (bfd *abfd, const struct elf_backend_data *out_be)
+{
+  const struct elf_backend_data *in_be = get_elf_backend_data (abfd);
+  
+  return bfd_get_flavour (abfd) == bfd_target_elf_flavour
+    && bfd_count_sections (abfd) != 0
+    && (abfd->flags & (DYNAMIC | BFD_PLUGIN | BFD_LINKER_CREATED)) == 0
+    && out_be->elf_machine_code == in_be->elf_machine_code
+    && out_be->s->elfclass == in_be->s->elfclass;
+}
+
 /* Find the first input bfd with GNU properties.
    If such an input is found, set found to true and return the relevant input.
    Otherwise, return the last input of bfd inputs.  */
@@ -712,22 +724,13 @@ bfd_linear_search_one_with_gnu_property (struct bfd_link_info *info)
 {
   const struct elf_backend_data *be = get_elf_backend_data (info->output_bfd);
 
-  bool bfd_is_non_dynamic_elf_object (bfd *abfd)
-  {
-    return (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
-       && (bfd_count_sections (abfd) != 0)
-       && (abfd->flags & (DYNAMIC | BFD_PLUGIN | BFD_LINKER_CREATED)) == 0
-       && (be->elf_machine_code == get_elf_backend_data (abfd)->elf_machine_code)
-       && (be->s->elfclass == get_elf_backend_data (abfd)->s->elfclass);
-  }
-
   bfd_search_result_t res = {
     .pbfd = NULL,
     .sec = NULL,
   };
 
   for (bfd *pbfd = info->input_bfds; pbfd != NULL; pbfd = pbfd->link.next)
-    if (bfd_is_non_dynamic_elf_object (pbfd))
+    if (bfd_is_non_dynamic_elf_object (pbfd, be))
       {
        res.pbfd = pbfd;