From: Nick Clifton Date: Wed, 5 Mar 2025 10:45:35 +0000 (+0000) Subject: elfxx-aarch64.c: Replace nested function with a static inline version instead. X-Git-Tag: binutils-2_45~1389 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b412c6b4db7689a8eba4ec0c9c7bd9efc8c055e;p=thirdparty%2Fbinutils-gdb.git elfxx-aarch64.c: Replace nested function with a static inline version instead. --- diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c index 317052071db..45a02058e81 100644 --- a/bfd/elfxx-aarch64.c +++ b/bfd/elfxx-aarch64.c @@ -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;