Stop readelf from complaining about out of order PT_LOAD segments.
authorNick Clifton <nickc@redhat.com>
Wed, 30 Nov 2016 11:06:42 +0000 (11:06 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 30 Nov 2016 11:06:42 +0000 (11:06 +0000)
PR ld/20815
* readelf.c (process_program_headers): Do not warn about out of
order PT_LOAD segments.

binutils/ChangeLog
binutils/readelf.c

index eab32c7d6493f9d57170cf7460b65c75c92791f5..35cd6911449c38681699183c6855120166ea3e08 100644 (file)
@@ -1,3 +1,9 @@
+2016-11-30  Nick Clifton  <nickc@redhat.com>
+
+       PR ld/20815
+       * readelf.c (process_program_headers): Do not warn about out of
+       order PT_LOAD segments.
+
 2016-11-29  Claudiu Zissulescu  <claziss@synopsys.com>
 
        * testsuite/binutils-all/arc/objdump.exp (Warning test): Update
index 347b6b96923b76eb96c1dc8448fa360f5a0a0e8e..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;