* descriptors.cc (Descriptors::open): Check that the options are
authorIan Lance Taylor <ian@airs.com>
Thu, 19 Mar 2009 19:02:53 +0000 (19:02 +0000)
committerIan Lance Taylor <ian@airs.com>
Thu, 19 Mar 2009 19:02:53 +0000 (19:02 +0000)
valid before using them.

gold/ChangeLog
gold/descriptors.cc

index 9dd8787befde475512ad8a0b7cf9bf74ad854902..96abf8ac1322b544bcdca542e93e566efaccce4c 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-19  Ian Lance Taylor  <iant@google.com>
+
+       * descriptors.cc (Descriptors::open): Check that the options are
+       valid before using them.
+
 2009-03-18  Ian Lance Taylor  <iant@google.com>
 
        * script-sections.h: Include <list>.
index 6937741841ff2c51c5ff1d8a7d84a5868118101a..b05bdf1a89d1031d9e7313bd41f5e5281662b952 100644 (file)
@@ -130,7 +130,9 @@ Descriptors::open(int descriptor, const char* name, int flags, int mode)
          // header file but not supported by the kernel.
          // Unfortunately there doesn't seem to be any obvious way to
          // detect that, as unknown flags passed to open are ignored.
-         if (O_CLOEXEC == 0 && parameters->options().has_plugins())
+         if (O_CLOEXEC == 0
+             && parameters->options_valid()
+             && parameters->options().has_plugins())
            fcntl(new_descriptor, F_SETFD, FD_CLOEXEC);
 
          {