From 86587dd4ca8b8942ec9f8be1aaa53e6baab42702 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Thu, 21 Dec 1995 00:41:20 +0000 Subject: [PATCH] * elf.c (copy_private_bfd_data): When attaching sections to segments ignore sections that won't be allocated. Patch from Andreas Schwab. --- bfd/ChangeLog | 6 ++++++ bfd/elf.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ee63eb9999..aa3c20a49a 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 9da5010334..a7bdf5cbb7 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;