/* Get the list of DT_NEEDED entries for a link. */
-struct bfd_elf_link_needed_list *
+struct bfd_link_needed_list *
bfd_elf_get_needed_list (abfd, info)
bfd *abfd;
struct bfd_link_info *info;
this_hdr->sh_type = SHT_PROGBITS;
else if ((asect->flags & SEC_ALLOC) != 0
&& ((asect->flags & SEC_LOAD) == 0))
- {
- BFD_ASSERT (strcmp (asect->name, ".bss") == 0
- || strcmp (asect->name, ".sbss") == 0
- || strcmp (asect->name, ".scommon") == 0
- || strcmp (asect->name, "COMMON") == 0);
- this_hdr->sh_type = SHT_NOBITS;
- }
+ this_hdr->sh_type = SHT_NOBITS;
else
{
/* Who knows? */
return (off + align - 1) & ~(align - 1);
}
-/* Assign a file position to a section, aligning to the required
- section alignment. */
+/* Assign a file position to a section, optionally aligning to the
+ required section alignment. */
INLINE file_ptr
-_bfd_elf_assign_file_position_for_section (i_shdrp, offset)
+_bfd_elf_assign_file_position_for_section (i_shdrp, offset, align)
Elf_Internal_Shdr *i_shdrp;
file_ptr offset;
+ boolean align;
{
- unsigned int al;
-
- /* Align the offst. */
- al = i_shdrp->sh_addralign;
- if (al > 1)
- offset = BFD_ALIGN (offset, al);
+ 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;
continue;
}
- off = _bfd_elf_assign_file_position_for_section (hdr, off);
+ off = _bfd_elf_assign_file_position_for_section (hdr, off, true);
}
}
else
hdr->sh_offset = -1;
continue;
}
- off = _bfd_elf_assign_file_position_for_section (hdr, off);
+ off = _bfd_elf_assign_file_position_for_section (hdr, off,
+ true);
}
else
{
the page size. This is required by the program
header. */
off += (hdr->sh_addr - off) % maxpagesize;
- off = _bfd_elf_assign_file_position_for_section (hdr, off);
+ off = _bfd_elf_assign_file_position_for_section (hdr, off,
+ false);
}
}
shdrp = *shdrpp;
if ((shdrp->sh_type == SHT_REL || shdrp->sh_type == SHT_RELA)
&& shdrp->sh_offset == -1)
- off = _bfd_elf_assign_file_position_for_section (shdrp, off);
+ off = _bfd_elf_assign_file_position_for_section (shdrp, off, true);
}
elf_tdata (abfd)->next_file_pos = off;