public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* RFC: Short circuit bfd_map_over_sections
@ 2004-04-30  0:12 H. J. Lu
  2004-04-30  0:15 ` Ian Lance Taylor
  2004-04-30  4:15 ` Alan Modra
  0 siblings, 2 replies; 13+ messages in thread
From: H. J. Lu @ 2004-04-30  0:12 UTC (permalink / raw)
  To: binutils

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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-05-02 13:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-30  0:12 RFC: Short circuit bfd_map_over_sections H. J. Lu
2004-04-30  0:15 ` Ian Lance Taylor
2004-04-30  0:20   ` H. J. Lu
2004-04-30  0:29     ` Eric Christopher
2004-04-30  1:33     ` Ian Lance Taylor
2004-04-30  1:36       ` H. J. Lu
2004-04-30  7:29         ` Nick Clifton
2004-04-30  4:15 ` Alan Modra
2004-04-30  5:25   ` H. J. Lu
2004-04-30 17:53   ` PATCH: Add bfd_get_section_by_name_if H. J. Lu
2004-05-01 14:20     ` Alan Modra
2004-05-01 15:19       ` H. J. Lu
2004-05-02 13:32         ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).