diff options
author | Ken Raeburn <raeburn@cygnus> | 1995-12-21 00:41:20 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@cygnus> | 1995-12-21 00:41:20 +0000 |
commit | 86587dd4ca8b8942ec9f8be1aaa53e6baab42702 (patch) | |
tree | b1e9acb56be7c4dc685626830d4e2671c7a83c64 /bfd/elf.c | |
parent | d1265690b14611e1c96edf5b4935d09eca6b3988 (diff) | |
download | gdb-86587dd4ca8b8942ec9f8be1aaa53e6baab42702.zip gdb-86587dd4ca8b8942ec9f8be1aaa53e6baab42702.tar.gz gdb-86587dd4ca8b8942ec9f8be1aaa53e6baab42702.tar.bz2 |
* elf.c (copy_private_bfd_data): When attaching sections to segments ignore
sections that won't be allocated. Patch from Andreas Schwab.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r-- | bfd/elf.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |