This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC: Short circuit bfd_map_over_sections


bfd_map_over_sections is used to call a function on each section in
a bfd. However, there are many places where bfd_map_over_sections
is called to find something. It isn't necessary to go through all
sections once it is found. I'd like to modify bfd_map_over_sections to

void
bfd_map_over_sections (bfd *abfd,
		       bfd_boolean (*operation) (bfd *, asection *, void *),
		       void *user_storage)
{
  asection *sect;

  for (sect = abfd->sections; sect != NULL; i++, sect = sect->next)
    if (!(*operation) (abfd, sect, user_storage))
      break;
}

Any comments?


H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]