From 8981c88a1e028446400c393b82fc415481cc07c3 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 12 Jun 2012 12:55:11 +0000 Subject: 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. --- bfd/elf.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bfd/elf.c') diff --git a/bfd/elf.c b/bfd/elf.c index 6755a4e..0296ef5 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 { -- cgit v1.1