before it was rewritten....
Possible errors are:
- o <<invalid_operation>> -
+ o <<bfd_error_invalid_operation>> -
If output has already started for this BFD.
- o <<no_memory>> -
+ o <<bfd_error_no_memory>> -
If obstack alloc fails.
*/
is already a section with that name.
Return <<NULL>> and set <<bfd_error>> on error; possible errors are:
- o <<invalid_operation>> - If output has already started for @var{abfd}.
- o <<no_memory>> - If obstack alloc fails.
+ o <<bfd_error_invalid_operation>> - If output has already started for @var{abfd}.
+ o <<bfd_error_no_memory>> - If obstack alloc fails.
*/
sec_ptr
if (abfd->output_has_begun)
{
- bfd_error = invalid_operation;
+ bfd_set_error (bfd_error_invalid_operation);
return NULL;
}
newsect = (asection *) bfd_zalloc(abfd, sizeof (asection));
if (newsect == NULL) {
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return NULL;
}
asection *bfd_make_section(bfd *, CONST char *name);
DESCRIPTION
- Like <<bfd_make_section_anyway>>, but return <<NULL>> (without setting
- bfd_error) without changing the section chain if there is already a
+ Like <<bfd_make_section_anyway>>, but return <<NULL>> (without calling
+ bfd_set_error ()) without changing the section chain if there is already a
section named @var{name}. If there is an error, return <<NULL>> and set
<<bfd_error>>.
*/
@var{abfd} to the value @var{flags}. Return <<true>> on success,
<<false>> on error. Possible error returns are:
- o <<invalid_operation>> -
+ o <<bfd_error_invalid_operation>> -
The section cannot have one or more of the attributes
requested. For example, a .bss section in <<a.out>> may not
have the <<SEC_HAS_CONTENTS>> field set.
set - which it doesn't, at least not for a.out. FIXME */
if ((flags & bfd_applicable_section_flags (abfd)) != flags) {
- bfd_error = invalid_operation;
+ bfd_set_error (bfd_error_invalid_operation);
return false;
}
#endif
ok, then <<true>> is returned, else <<false>>.
Possible error returns:
- o <<invalid_operation>> -
+ o <<bfd_error_invalid_operation>> -
Writing has started to the BFD, so setting the size is invalid.
*/
the size of any others. */
if (abfd->output_has_begun) {
- bfd_error = invalid_operation;
+ bfd_set_error (bfd_error_invalid_operation);
return false;
}
Normally <<true>> is returned, else <<false>>. Possible error
returns are:
- o <<no_contents>> -
+ o <<bfd_error_no_contents>> -
The output section does not have the <<SEC_HAS_CONTENTS>>
attribute, so nothing can be written to it.
o and some more too
if (!bfd_get_section_flags(abfd, section) & SEC_HAS_CONTENTS)
{
- bfd_error = no_contents;
+ bfd_set_error (bfd_error_no_contents);
return(false);
}
if (offset < 0)
{
bad_val:
- bfd_error = bad_value;
+ bfd_set_error (bfd_error_bad_value);
return false;
}
sz = bfd_get_section_size_now (abfd, section);
{
case read_direction:
case no_direction:
- bfd_error = invalid_operation;
+ bfd_set_error (bfd_error_invalid_operation);
return false;
case write_direction:
if (offset < 0)
{
bad_val:
- bfd_error = bad_value;
+ bfd_set_error (bfd_error_bad_value);
return false;
}
/* Even if reloc_done is true, this function reads unrelocated