- pos = sec->output_section->filepos + sec->output_offset;
- if (bfd_seek (output_bfd, pos, SEEK_SET) != 0)
- return FALSE;
+ /* FIXME: octets_per_byte. */
+ hdr = &elf_section_data (sec->output_section)->this_hdr;
+ if (hdr->sh_offset == (file_ptr) -1)
+ {
+ /* We must compress this section. Write output to the
+ buffer. */
+ contents = hdr->contents;
+ if ((sec->output_section->flags & SEC_ELF_COMPRESS) == 0
+ || contents == NULL)
+ abort ();
+ }
+ else
+ {
+ contents = NULL;
+ pos = sec->output_section->filepos + sec->output_offset;
+ if (bfd_seek (output_bfd, pos, SEEK_SET) != 0)
+ return FALSE;
+ }