forked from Imagelibrary/binutils-gdb
PR binutils/12467
* readelf.c (process_program_headers): Issue a warning if there are no program headers but the file header has a non-zero program header offset. (process_section_headers): Issue a warning if there are no section headers but the file header has a non-zero section header offset. (process_section_groups): Reword the no section message so that it can be distinguished from the one issued by process_section_headers. * elf.c (assign_file_positions_for_load_sections): Set the program header offset and entry size to zero if there are no program headers.
This commit is contained in:
14
bfd/elf.c
14
bfd/elf.c
@@ -4334,8 +4334,18 @@ assign_file_positions_for_load_sections (bfd *abfd,
|
||||
header_pad = m->header_size;
|
||||
}
|
||||
|
||||
elf_elfheader (abfd)->e_phoff = bed->s->sizeof_ehdr;
|
||||
elf_elfheader (abfd)->e_phentsize = bed->s->sizeof_phdr;
|
||||
if (alloc)
|
||||
{
|
||||
elf_elfheader (abfd)->e_phoff = bed->s->sizeof_ehdr;
|
||||
elf_elfheader (abfd)->e_phentsize = bed->s->sizeof_phdr;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* PR binutils/12467. */
|
||||
elf_elfheader (abfd)->e_phoff = 0;
|
||||
elf_elfheader (abfd)->e_phentsize = 0;
|
||||
}
|
||||
|
||||
elf_elfheader (abfd)->e_phnum = alloc;
|
||||
|
||||
if (elf_tdata (abfd)->program_header_size == (bfd_size_type) -1)
|
||||
|
||||
Reference in New Issue
Block a user