summaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-06-12 12:55:07 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-06-12 12:55:07 +0000
commitd67a62d36b0d3a709789b52425eb34ba4edbad6c (patch)
tree5428f17d65f3caaa2610f904e61cd4beb63e3d8d /bfd/elf.c
parent2d6cce641124d25230506a1797c6fe996641eafa (diff)
downloadbinutils-redhat-d67a62d36b0d3a709789b52425eb34ba4edbad6c.tar.gz
Abort if PT_GNU_RELRO segment doesn't fit in PT_LOAD segment
bfd/ PR bfd/14207 * elf.c (assign_file_positions_for_non_load_sections): Abort if PT_GNU_RELRO segment doesn't fit in PT_LOAD segment. ld/testsuite/ PR ld/14207 * ld-x86-64/x86-64.exp: Run pr14207. * ld-x86-64/pr14207.d: New file. * ld-x86-64/pr14207.s: Likewise.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 6755a4e309..0296ef5672 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4931,6 +4931,11 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
&& lp->p_vaddr + lp->p_filesz >= link_info->relro_end)
break;
}
+
+ /* PR ld/14207. If the RELRO segment doesn't fit in the
+ LOAD segment, it should be removed. */
+ if (lp == (phdrs + count))
+ abort ();
}
else
{