mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 13:56:22 +08:00
objcopy/strip ELF program header p_vaddr confusion
copy_elf_program_header has logic to reject non-alloc sections when calculating p_vaddr offset for padding, but blithely assumed the first section in a segment was allocated. PR 16690 * elf.c (copy_elf_program_header): Ignore first section lma if non-alloc.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2014-03-12 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
PR 16690
|
||||||
|
* elf.c (copy_elf_program_header): Ignore first section lma if
|
||||||
|
non-alloc.
|
||||||
|
|
||||||
2014-03-11 Alan Modra <amodra@gmail.com>
|
2014-03-11 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
PR 16686
|
PR 16686
|
||||||
|
@ -6259,7 +6259,7 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd)
|
|||||||
phdr_included = TRUE;
|
phdr_included = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
lowest_section = first_section;
|
lowest_section = NULL;
|
||||||
if (section_count != 0)
|
if (section_count != 0)
|
||||||
{
|
{
|
||||||
unsigned int isec = 0;
|
unsigned int isec = 0;
|
||||||
@ -6276,7 +6276,8 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd)
|
|||||||
{
|
{
|
||||||
bfd_vma seg_off;
|
bfd_vma seg_off;
|
||||||
|
|
||||||
if (section->lma < lowest_section->lma)
|
if (lowest_section == NULL
|
||||||
|
|| section->lma < lowest_section->lma)
|
||||||
lowest_section = section;
|
lowest_section = section;
|
||||||
|
|
||||||
/* Section lmas are set up from PT_LOAD header
|
/* Section lmas are set up from PT_LOAD header
|
||||||
|
Reference in New Issue
Block a user