Fri Jan 12 13:59:16 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf.c (assign_file_positions_for_segments): If a segment
+ contains no sections, don't mark it as readable.
+
* elf-bfd.h (_bfd_elf_section_from_bfd_section): Declare.
* elfcode.h (_bfd_elf_section_from_bfd_section): Don't declare.
if (m->p_flags_valid)
p->p_flags = m->p_flags;
+ else
+ p->p_flags = 0;
if (p->p_type == PT_LOAD && m->count > 0)
off += (m->sections[0]->vma - off) % bed->maxpagesize;
if (m->includes_filehdr)
{
+ if (! m->p_flags_valid)
+ p->p_flags |= PF_R;
p->p_offset = 0;
p->p_filesz = bed->s->sizeof_ehdr;
p->p_memsz = bed->s->sizeof_ehdr;
if (m->includes_phdrs)
{
+ if (! m->p_flags_valid)
+ p->p_flags |= PF_R;
if (m->includes_filehdr)
{
if (p->p_type == PT_LOAD)
}
}
- if (! m->p_flags_valid)
- p->p_flags = PF_R;
for (i = 0, secpp = m->sections; i < m->count; i++, secpp++)
{
asection *sec;
if (! m->p_flags_valid)
{
+ p->p_flags |= PF_R;
if ((flags & SEC_CODE) != 0)
p->p_flags |= PF_X;
if ((flags & SEC_READONLY) == 0)