Index: bfd/section.c =================================================================== RCS file: /cvs/src/src/bfd/section.c,v retrieving revision 1.44 diff -u -3 -r1.44 section.c --- bfd/section.c 30 Jan 2002 18:12:16 -0000 1.44 +++ bfd/section.c 19 Apr 2002 21:19:44 -0000 @@ -772,6 +772,56 @@ /* FUNCTION + bfd_get_first_code_section + +SYNOPSIS + asection *bfd_get_first_code_section(bfd *abfd); + +DESCRIPTION + Run through @var{abfd} and return the first + <>s whose flagged SEC_CODE, <> + @xref{Sections} if none (just in case .. ) +*/ + +asection * +bfd_get_first_code_section (abfd) + bfd *abfd; +{ + asection *sect; + + for (sect = abfd->sections; sect != NULL; sect = sect->next) + if (sect->flags & SEC_CODE) + return sect; + return NULL; +} + +/* +FUNCTION + bfd_get_first_data_section + +SYNOPSIS + asection *bfd_get_first_data_section(bfd *abfd); + +DESCRIPTION + Run through @var{abfd} and return the first + <>s whose flagged SEC_DATA, <> + @xref{Sections} if none (just in case .. ) +*/ + +asection * +bfd_get_first_data_section (abfd) + bfd *abfd; +{ + asection *sect; + + for (sect = abfd->sections; sect != NULL; sect = sect->next) + if (sect->flags & SEC_DATA) + return sect; + return NULL; +} + +/* +FUNCTION bfd_get_unique_section_name SYNOPSIS Index: bfd/bfd-in2.h =================================================================== RCS file: /cvs/src/src/bfd/bfd-in2.h,v retrieving revision 1.149 diff -u -3 -r1.149 bfd-in2.h --- bfd/bfd-in2.h 4 Apr 2002 19:53:34 -0000 1.149 +++ bfd/bfd-in2.h 19 Apr 2002 21:19:45 -0000 @@ -1401,6 +1401,12 @@ asection * bfd_get_section_by_name PARAMS ((bfd *abfd, const char *name)); + +asection * +bfd_get_first_code_section PARAMS ((bfd *abfd)); + +asection * +bfd_get_first_data_section PARAMS ((bfd *abfd)); char * bfd_get_unique_section_name PARAMS ((bfd *abfd,