diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2016-07-20 07:50:42 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2016-07-20 07:50:56 -0700 |
commit | 9ab8247228844bb6608d6b2c99b6d8732bab08c1 (patch) | |
tree | de829dde6a7a8e3baee15ac1042cdf3370bb95e4 /bfd/elf.c | |
parent | 027d97f8b0193a8113ee60bafc686d45d0af59ee (diff) | |
download | gdb-9ab8247228844bb6608d6b2c99b6d8732bab08c1.zip gdb-9ab8247228844bb6608d6b2c99b6d8732bab08c1.tar.gz gdb-9ab8247228844bb6608d6b2c99b6d8732bab08c1.tar.bz2 |
Check p_paddr for program header space
Issue an error if p_paddr becomes invalid when allocating space for
program headers.
PR ld/20376
* elf.c (assign_file_positions_for_load_sections): Also check
p_paddr for program header space.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r-- | bfd/elf.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -5271,7 +5271,9 @@ assign_file_positions_for_load_sections (bfd *abfd, p->p_memsz = bed->s->sizeof_ehdr; if (m->count > 0) { - if (p->p_vaddr < (bfd_vma) off) + if (p->p_vaddr < (bfd_vma) off + || (!m->p_paddr_valid + && p->p_paddr < (bfd_vma) off)) { (*_bfd_error_handler) (_("%B: Not enough room for program headers, try linking with -N"), |