PR4499, assign file positions assumes segment offsets increasing
[deliverable/binutils-gdb.git] / include / elf / internal.h
index e29fc40df6297790989f34298a5cb4e214e20af6..794c16812eea6c3cb6acda720203920549364500 100644 (file)
@@ -273,8 +273,6 @@ struct elf_segment_map
   bfd_vma p_align;
   /* Segment size in file and memory */
   bfd_vma p_size;
-  /* Required size of filehdr + phdrs, if non-zero */
-  bfd_vma header_size;
   /* Whether the p_flags field is valid; if not, the flags are based
      on the section flags.  */
   unsigned int p_flags_valid : 1;
@@ -291,6 +289,13 @@ struct elf_segment_map
   unsigned int includes_filehdr : 1;
   /* Whether this segment includes the program headers.  */
   unsigned int includes_phdrs : 1;
+  /* Assume this PT_LOAD header has an lma of zero when sorting
+     headers before assigning file offsets.  PT_LOAD headers with this
+     flag set are placed after one with includes_filehdr set, and
+     before PT_LOAD headers without this flag set.  */
+  unsigned int no_sort_lma : 1;
+  /* Index holding original order before sorting segments.  */
+  unsigned int idx;
   /* Number of sections (may be 0).  */
   unsigned int count;
   /* Sections.  Actual number of elements is in count field.  */
@@ -330,8 +335,10 @@ struct elf_segment_map
        && ((segment)->p_type == PT_LOAD                                \
            || (segment)->p_type == PT_DYNAMIC                          \
            || (segment)->p_type == PT_GNU_EH_FRAME                     \
+           || (segment)->p_type == PT_GNU_STACK                        \
            || (segment)->p_type == PT_GNU_RELRO                        \
-           || (segment)->p_type == PT_GNU_STACK))                      \
+           || ((segment)->p_type >= PT_GNU_MBIND_LO                    \
+               && (segment)->p_type <= PT_GNU_MBIND_HI)))              \
    /* Any section besides one of type SHT_NOBITS must have file                \
       offsets within the segment.  */                                  \
    && ((sec_hdr)->sh_type == SHT_NOBITS                                        \
This page took 0.024439 seconds and 4 git commands to generate.