mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-28 23:39:35 +08:00
* elf.c (rewrite_elf_program_header): Don't wrap p_paddr to
include file or program headers.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2008-08-01 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* elf.c (rewrite_elf_program_header): Don't wrap p_paddr to
|
||||||
|
include file or program headers.
|
||||||
|
|
||||||
2008-07-30 Alan Modra <amodra@bigpond.net.au>
|
2008-07-30 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* coff-ppc.c, coffgen.c, ecoff.c, ecofflink.c, elf.c, elf32-frv.c,
|
* coff-ppc.c, coffgen.c, ecoff.c, ecofflink.c, elf.c, elf32-frv.c,
|
||||||
|
31
bfd/elf.c
31
bfd/elf.c
@ -5559,19 +5559,32 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
|
|||||||
/* Offset the segment physical address from the lma
|
/* Offset the segment physical address from the lma
|
||||||
to allow for space taken up by elf headers. */
|
to allow for space taken up by elf headers. */
|
||||||
if (map->includes_filehdr)
|
if (map->includes_filehdr)
|
||||||
map->p_paddr -= iehdr->e_ehsize;
|
{
|
||||||
|
if (map->p_paddr >= iehdr->e_ehsize)
|
||||||
|
map->p_paddr -= iehdr->e_ehsize;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
map->includes_filehdr = FALSE;
|
||||||
|
map->includes_phdrs = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (map->includes_phdrs)
|
if (map->includes_phdrs)
|
||||||
{
|
{
|
||||||
map->p_paddr -= iehdr->e_phnum * iehdr->e_phentsize;
|
if (map->p_paddr >= iehdr->e_phnum * iehdr->e_phentsize)
|
||||||
|
{
|
||||||
|
map->p_paddr -= iehdr->e_phnum * iehdr->e_phentsize;
|
||||||
|
|
||||||
/* iehdr->e_phnum is just an estimate of the number
|
/* iehdr->e_phnum is just an estimate of the number
|
||||||
of program headers that we will need. Make a note
|
of program headers that we will need. Make a note
|
||||||
here of the number we used and the segment we chose
|
here of the number we used and the segment we chose
|
||||||
to hold these headers, so that we can adjust the
|
to hold these headers, so that we can adjust the
|
||||||
offset when we know the correct value. */
|
offset when we know the correct value. */
|
||||||
phdr_adjust_num = iehdr->e_phnum;
|
phdr_adjust_num = iehdr->e_phnum;
|
||||||
phdr_adjust_seg = map;
|
phdr_adjust_seg = map;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
map->includes_phdrs = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user