FreeBSD/contrib/binutils/bfd/elf.c
/* Assign a file position to a section, optionally aligning to the
   required section alignment.  */
Assign a file position to a section, optionally aligning to the
required section alignment.
Assign a file position to a section optionally aligning to the required section alignment .
file_ptr
_bfd_elf_assign_file_position_for_section (Elf_Internal_Shdr *i_shdrp,
					   file_ptr offset,
					   bfd_boolean align)
{
  if (align)
    {
      unsigned int al;
      al = i_shdrp->sh_addralign;
      if (al > 1)
	offset = BFD_ALIGN (offset, al);
    }
  i_shdrp->sh_offset = offset;
  if (i_shdrp->bfd_section != NULL)
    i_shdrp->bfd_section->filepos = offset;
  if (i_shdrp->sh_type != SHT_NOBITS)
    offset += i_shdrp->sh_size;
  return offset;
}
file_ptr _bfd_elf_assign_file_position_for_section ( Elf_Internal_Shdr * i_shdrp , file_ptr offset , bfd_boolean align ) { if ( align ) { unsigned int al ; al = i_shdrp -> sh_addralign ; if ( al > 1 ) offset = BFD_ALIGN ( offset , al ) ; } i_shdrp -> sh_offset = offset ; if ( i_shdrp -> bfd_section != NULL ) i_shdrp -> bfd_section -> filepos = offset ; if ( i_shdrp -> sh_type != SHT_NOBITS ) offset += i_shdrp -> sh_size ; return offset ; }
Assign a file position to a section, optionally aligning to the
required section alignment.
Assign a file position to a section optionally aligning to the required section alignment .