aboutsummaryrefslogtreecommitdiff
path: root/bfd/section.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2005-05-17 19:44:55 +0000
committerDaniel Jacobowitz <drow@false.org>2005-05-17 19:44:55 +0000
commit26ae6d5ed03b3e749598b33ffd0aaefbaf9a6d7d (patch)
treea2a86631e13f89e100ac36db20db4170c9610924 /bfd/section.c
parent970c3dbce892feccbd6334ebc431a82b84934efd (diff)
downloadgdb-26ae6d5ed03b3e749598b33ffd0aaefbaf9a6d7d.zip
gdb-26ae6d5ed03b3e749598b33ffd0aaefbaf9a6d7d.tar.gz
gdb-26ae6d5ed03b3e749598b33ffd0aaefbaf9a6d7d.tar.bz2
* elf.c (_bfd_elf_write_object_contents): Check for non-NULL
elf_shstrtab. * format.c (bfd_check_format_matches): Set output_has_begun for both_direction. * section.c (bfd_set_section_contents): Use bfd_write_p. Remove special case for both_direction.
Diffstat (limited to 'bfd/section.c')
-rw-r--r--bfd/section.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/bfd/section.c b/bfd/section.c
index 4e46a5d..75acad7 100644
--- a/bfd/section.c
+++ b/bfd/section.c
@@ -1346,22 +1346,10 @@ bfd_set_section_contents (bfd *abfd,
return FALSE;
}
- switch (abfd->direction)
+ if (!bfd_write_p (abfd))
{
- case read_direction:
- case no_direction:
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
-
- case write_direction:
- break;
-
- case both_direction:
- /* File is opened for update. `output_has_begun' some time ago when
- the file was created. Do not recompute sections sizes or alignments
- in _bfd_set_section_content. */
- abfd->output_has_begun = TRUE;
- break;
}
/* Record a copy of the data in memory if desired. */