diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ee63eb99997..aa3c20a49a3 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +Wed Dec 20 19:14:18 1995 Ken Raeburn + + * elf.c (copy_private_bfd_data): When attaching sections to + segments ignore sections that won't be allocated. Patch from + Andreas Schwab. + Tue Dec 19 20:01:43 1995 Ken Raeburn * config.bfd: Match on m68k-cbm-* only if OS doesn't match diff --git a/bfd/elf.c b/bfd/elf.c index 9da50103349..a7bdf5cbb76 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -2197,7 +2197,7 @@ prep_headers (abfd) i_ehdrp->e_ident[EI_CLASS] = bed->s->elfclass; i_ehdrp->e_ident[EI_DATA] = - abfd->xvec->byteorder_big_p ? ELFDATA2MSB : ELFDATA2LSB; + bfd_big_endian (abfd) ? ELFDATA2MSB : ELFDATA2LSB; i_ehdrp->e_ident[EI_VERSION] = bed->s->ev_current; for (count = EI_PAD; count < EI_NIDENT; count++) @@ -2512,6 +2512,7 @@ copy_private_bfd_data (ibfd, obfd) && (bfd_vma) s->filepos >= p->p_offset && ((bfd_vma) s->filepos + s->_raw_size <= p->p_offset + p->p_filesz))) + && (s->flags & SEC_ALLOC) != 0 && s->output_section != NULL) ++csecs; @@ -2549,6 +2550,7 @@ copy_private_bfd_data (ibfd, obfd) && (bfd_vma) s->filepos >= p->p_offset && ((bfd_vma) s->filepos + s->_raw_size <= p->p_offset + p->p_filesz))) + && (s->flags & SEC_ALLOC) != 0 && s->output_section != NULL) { m->sections[isec] = s->output_section;