2004-04-30 H.J. Lu <hongjiu.lu@intel.com>

* section.c (bfd_sections_find_if): New.
	* bfd-in2.h: Regenerated.
This commit is contained in:
H.J. Lu 2004-04-30 15:01:15 +00:00
parent f2da459f65
commit bc87dd2ec1
3 changed files with 45 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2004-04-30 H.J. Lu <hongjiu.lu@intel.com>
* section.c (bfd_sections_find_if): New.
* bfd-in2.h: Regenerated.
2004-04-30 Alan Modra <amodra@bigpond.net.au>
* section.c (bfd_make_section_anyway): Add all sections to hash tab.

View File

@ -1450,6 +1450,11 @@ void bfd_map_over_sections
void (*func) (bfd *abfd, asection *sect, void *obj),
void *obj);
asection *bfd_sections_find_if
(bfd *abfd,
bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
void *obj);
bfd_boolean bfd_set_section_size
(bfd *abfd, asection *sec, bfd_size_type val);

View File

@ -1094,6 +1094,41 @@ bfd_map_over_sections (bfd *abfd,
abort ();
}
/*
FUNCTION
bfd_sections_find_if
SYNOPSIS
asection *bfd_sections_find_if
(bfd *abfd,
bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
void *obj);
DESCRIPTION
Call the provided function @var{func} for each section
attached to the BFD @var{abfd}, passing @var{obj} as an
argument. The function will be called as if by
| func (abfd, the_section, obj);
It returns the first section for which @var{func} returns true.
*/
asection *
bfd_sections_find_if (bfd *abfd,
bfd_boolean (*operation) (bfd *, asection *, void *),
void *user_storage)
{
asection *sect;
for (sect = abfd->sections; sect != NULL; sect = sect->next)
if ((*operation) (abfd, sect, user_storage))
break;
return sect;
}
/*
FUNCTION
bfd_set_section_size