aboutsummaryrefslogtreecommitdiff
path: root/include/elf
diff options
context:
space:
mode:
Diffstat (limited to 'include/elf')
-rw-r--r--include/elf/ChangeLog5
-rw-r--r--include/elf/internal.h7
2 files changed, 12 insertions, 0 deletions
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index 2f2fc80..e4e094b 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-24 Alan Modra <amodra@gmail.com>
+
+ * internal.h (ELF_SECTION_IN_SEGMENT_1): Ensure PT_LOAD and
+ similar segments only contain alloc sections.
+
2015-04-24 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/18316
diff --git a/include/elf/internal.h b/include/elf/internal.h
index b2492f5..b49dd61 100644
--- a/include/elf/internal.h
+++ b/include/elf/internal.h
@@ -325,6 +325,13 @@ struct elf_segment_map
|| (((sec_hdr)->sh_flags & SHF_TLS) == 0 \
&& (segment)->p_type != PT_TLS \
&& (segment)->p_type != PT_PHDR)) \
+ /* PT_LOAD and similar segments only have SHF_ALLOC sections. */ \
+ && !(((sec_hdr)->sh_flags & SHF_ALLOC) == 0 \
+ && ((segment)->p_type == PT_LOAD \
+ || (segment)->p_type == PT_DYNAMIC \
+ || (segment)->p_type == PT_GNU_EH_FRAME \
+ || (segment)->p_type == PT_GNU_RELRO \
+ || (segment)->p_type == PT_GNU_STACK)) \
/* Any section besides one of type SHT_NOBITS must have file \
offsets within the segment. */ \
&& ((sec_hdr)->sh_type == SHT_NOBITS \