summaryrefslogtreecommitdiff
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
commitc02f6f29ca5977ffd83d0193c6e508cf7d5a33b3 (patch)
treee808328247eff1acae90c0bb13f0e2b865b53a75
parenta5a29dc08d74b30a5111ff66a9468e11ac8d9f82 (diff)
downloadgdb-c02f6f29ca5977ffd83d0193c6e508cf7d5a33b3.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.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf.c5
2 files changed, 11 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 5c5c07c1b1c..7386412d11b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ 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.
+
2012-06-12 Alan Modra <amodra@gmail.com>
PR ld/14207
diff --git a/bfd/elf.c b/bfd/elf.c
index 6755a4e3090..0296ef56720 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
{