* elf.c (elf_fake_sections): Remove bogus BFD_ASSERT.

PR 8293.
This commit is contained in:
Ian Lance Taylor 1995-10-30 19:56:30 +00:00
parent c5ba27591a
commit 5fe14a9f51
2 changed files with 23 additions and 21 deletions

View File

@ -1,3 +1,7 @@
Mon Oct 30 14:53:48 1995 Ian Lance Taylor <ian@cygnus.com>
* elf.c (elf_fake_sections): Remove bogus BFD_ASSERT.
Sat Oct 28 01:25:34 1995 steve chamberlain <sac@slash.cygnus.com> Sat Oct 28 01:25:34 1995 steve chamberlain <sac@slash.cygnus.com>
* cofflink.c (_bfd_coff_generic_relocate_section): Make * cofflink.c (_bfd_coff_generic_relocate_section): Make

View File

@ -451,7 +451,7 @@ bfd_elf_set_dt_needed_name (abfd, name)
/* Get the list of DT_NEEDED entries for a link. */ /* 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_elf_get_needed_list (abfd, info)
bfd *abfd; bfd *abfd;
struct bfd_link_info *info; struct bfd_link_info *info;
@ -929,13 +929,7 @@ elf_fake_sections (abfd, asect, failedptrarg)
this_hdr->sh_type = SHT_PROGBITS; this_hdr->sh_type = SHT_PROGBITS;
else if ((asect->flags & SEC_ALLOC) != 0 else if ((asect->flags & SEC_ALLOC) != 0
&& ((asect->flags & SEC_LOAD) == 0)) && ((asect->flags & SEC_LOAD) == 0))
{ this_hdr->sh_type = SHT_NOBITS;
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;
}
else else
{ {
/* Who knows? */ /* Who knows? */
@ -1420,21 +1414,23 @@ align_file_position (off, align)
return (off + align - 1) & ~(align - 1); return (off + align - 1) & ~(align - 1);
} }
/* Assign a file position to a section, aligning to the required /* Assign a file position to a section, optionally aligning to the
section alignment. */ required section alignment. */
INLINE file_ptr 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; Elf_Internal_Shdr *i_shdrp;
file_ptr offset; file_ptr offset;
boolean align;
{ {
unsigned int al; if (align)
{
/* Align the offst. */ unsigned int al;
al = i_shdrp->sh_addralign;
if (al > 1)
offset = BFD_ALIGN (offset, al);
al = i_shdrp->sh_addralign;
if (al > 1)
offset = BFD_ALIGN (offset, al);
}
i_shdrp->sh_offset = offset; i_shdrp->sh_offset = offset;
if (i_shdrp->bfd_section != NULL) if (i_shdrp->bfd_section != NULL)
i_shdrp->bfd_section->filepos = offset; i_shdrp->bfd_section->filepos = offset;
@ -1883,7 +1879,7 @@ assign_file_positions_except_relocs (abfd, dosyms)
continue; continue;
} }
off = _bfd_elf_assign_file_position_for_section (hdr, off); off = _bfd_elf_assign_file_position_for_section (hdr, off, true);
} }
} }
else else
@ -1953,7 +1949,8 @@ assign_file_positions_except_relocs (abfd, dosyms)
hdr->sh_offset = -1; hdr->sh_offset = -1;
continue; continue;
} }
off = _bfd_elf_assign_file_position_for_section (hdr, off); off = _bfd_elf_assign_file_position_for_section (hdr, off,
true);
} }
else else
{ {
@ -1964,7 +1961,8 @@ assign_file_positions_except_relocs (abfd, dosyms)
the page size. This is required by the program the page size. This is required by the program
header. */ header. */
off += (hdr->sh_addr - off) % maxpagesize; 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);
} }
} }
@ -2180,7 +2178,7 @@ _bfd_elf_assign_file_positions_for_relocs (abfd)
shdrp = *shdrpp; shdrp = *shdrpp;
if ((shdrp->sh_type == SHT_REL || shdrp->sh_type == SHT_RELA) if ((shdrp->sh_type == SHT_REL || shdrp->sh_type == SHT_RELA)
&& shdrp->sh_offset == -1) && 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; elf_tdata (abfd)->next_file_pos = off;