* elf.c (copy_private_bfd_data): When attaching sections to segments ignore

sections that won't be allocated.  Patch from Andreas Schwab.
This commit is contained in:
Ken Raeburn 1995-12-21 00:41:20 +00:00
parent d1265690b1
commit 86587dd4ca
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,9 @@
Wed Dec 20 19:14:18 1995 Ken Raeburn <raeburn@cygnus.com>
* 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 <raeburn@cygnus.com>
* config.bfd: Match on m68k-cbm-* only if OS doesn't match

View File

@ -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;