* layout.cc (Layout::finish_dynamic_section): Don't create
authorIan Lance Taylor <ian@airs.com>
Sat, 18 Jun 2011 22:34:24 +0000 (22:34 +0000)
committerIan Lance Taylor <ian@airs.com>
Sat, 18 Jun 2011 22:34:24 +0000 (22:34 +0000)
DT_FLAGS entry if not needed.

gold/ChangeLog
gold/layout.cc

index e4c6287593f6645c48269d8866bdbc3f812fc2f5..3b79d95e05c91a1f15c3ab691f2a25ac3acefb60 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-18  Ian Lance Taylor  <iant@google.com>
+
+       * layout.cc (Layout::finish_dynamic_section): Don't create
+       DT_FLAGS entry if not needed.
+
 2011-06-18  Ian Lance Taylor  <iant@google.com>
 
        PR gold/12745
index a3e60d52d186d09740e6327be597ae7ba2faf72d..f74c626a745464bc19c46b839f009b9a06dda57a 100644 (file)
@@ -4162,7 +4162,8 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
     }
   if (parameters->options().now())
     flags |= elfcpp::DF_BIND_NOW;
-  odyn->add_constant(elfcpp::DT_FLAGS, flags);
+  if (flags != 0)
+    odyn->add_constant(elfcpp::DT_FLAGS, flags);
 
   flags = 0;
   if (parameters->options().initfirst())
@@ -4187,7 +4188,7 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
     flags |= elfcpp::DF_1_ORIGIN;
   if (parameters->options().now())
     flags |= elfcpp::DF_1_NOW;
-  if (flags)
+  if (flags != 0)
     odyn->add_constant(elfcpp::DT_FLAGS_1, flags);
 }