PR23595, simple objcopy of executable failure for msp430-elf
authorJozef Lawrynowicz <jozef.l@mittosystems.com>
Mon, 3 Sep 2018 01:34:05 +0000 (11:04 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 3 Sep 2018 06:20:54 +0000 (15:50 +0930)
commit2542e49e21e6b7270f72c7be0fc4ff1a986371da
tree777d1a3646fb84149fcbf78912e675a0443851d6
parent0d9a433be406220413671495a9b0fab577a48b5e
PR23595, simple objcopy of executable failure for msp430-elf

VMA of the first section in the segment containing the ELF file header
(and possibly section headers too) can't be used to reliably find the
size of the headers plus padding.  What's really needed is sh_offset
of the first section assuming it has contents (vma does have a
relationship to sh_offset, but is only guaranteed in demand paged
executables).

If the first section is SHT_NOBITS and it hasn't been converted to
have file contents by the existence of a following SHT_PROGBITS
section in the same segment, the sh_offset value also isn't reliable.

PR 23595
elf.c (copy_elf_program_header): When first segment contains
only the headers and SHT_NOBITS sections, use segment p_filesz
to calculate header and padding size.  Use filepos of the first
section otherwise.
bfd/ChangeLog
bfd/elf.c
This page took 0.025434 seconds and 4 git commands to generate.