* object.cc (Sized_relobj::include_section_group): Check for
authorIan Lance Taylor <ian@airs.com>
Wed, 23 Apr 2008 17:40:19 +0000 (17:40 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 23 Apr 2008 17:40:19 +0000 (17:40 +0000)
invalid section group.

gold/ChangeLog
gold/object.cc

index 3e3f4fd511d0f42bb6394ce4be1cf46796258f0c..b73da9b4bf18e21beda803a1eec36ba8e115216f 100644 (file)
@@ -1,5 +1,8 @@
 2008-04-23  Ian Lance Taylor  <iant@google.com>
 
+       * object.cc (Sized_relobj::include_section_group): Check for
+       invalid section group.
+
        * object.cc (make_elf_object): Correct test for 64-bit ELF file
        header size.
 
index 9cfd8867d40eb2972d843bc95055223210d7a23b..1672225d0298c955fb5cd5c3276f380d524f8239 100644 (file)
@@ -609,6 +609,13 @@ Sized_relobj<size, big_endian>::include_section_group(
                      secnum, index);
          continue;
        }
+
+      // Check for an earlier section number, since we're going to get
+      // it wrong--we may have already decided to include the section.
+      if (secnum < index)
+        this->error(_("invalid section group %u refers to earlier section %u"),
+                    index, secnum);
+
       (*omit)[secnum] = true;
     }