Stop readelf from complaining about out of order PT_LOAD segments.
[binutils-gdb.git] / binutils / readelf.c
index ee55852bdb48f14a1dab3e65e40fa7eac54d95a4..c5a628fc9365586c2ac85db0dd844070d56b3f7b 100644 (file)
@@ -4909,9 +4909,13 @@ process_program_headers (FILE * file)
       switch (segment->p_type)
        {
        case PT_LOAD:
+#if 0 /* Do not warn about out of order PT_LOAD segments.  Although officially
+        required by the ELF standard, several programs, including the Linux
+        kernel, make use of non-ordered segments.  */
          if (previous_load
              && previous_load->p_vaddr > segment->p_vaddr)
            error (_("LOAD segments must be sorted in order of increasing VirtAddr\n"));
+#endif
          if (segment->p_memsz < segment->p_filesz)
            error (_("the segment's file size is larger than its memory size\n"));
          previous_load = segment;
@@ -9966,7 +9970,7 @@ process_version_sections (FILE * file)
                int j;
                int isum;
 
-               /* Check for very large indicies.  */
+               /* Check for very large indices.  */
                if (idx > (size_t) (endbuf - (char *) edefs))
                  break;