Add support for -z global.
authorDmitriy Ivanov <dimitry@google.com>
Mon, 1 Dec 2014 21:37:21 +0000 (13:37 -0800)
committerCary Coutant <ccoutant@google.com>
Mon, 1 Dec 2014 21:37:38 +0000 (13:37 -0800)
gold/
* layout.cc (Layout::finish_dynamic_section): When '-z global'
is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
* options.h (General_options): New -z option (global).

gold/ChangeLog
gold/layout.cc
gold/options.h

index 2daf182d951f122547672315c2a3a9c4ab443340..8bd1afc8c44091743cca9d59251763bb3c9e3662 100644 (file)
@@ -1,3 +1,9 @@
+2014-12-01  Dimitry Ivanov <dimitry@google.com>
+
+       * layout.cc (Layout::finish_dynamic_section): When '-z global'
+       is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
+       * options.h (General_options): New -z option (global).
+
 2014-12-01  Cary Coutant  <ccoutant@google.com>
 
        PR gold/17578
index a0d7c591cb0f1e82301abcacf02fe07955898db7..0a71a2a13b8ad5adcbc60ec23b3927c46d6a1f3e 100644 (file)
@@ -4883,6 +4883,8 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
     odyn->add_constant(elfcpp::DT_FLAGS, flags);
 
   flags = 0;
+  if (parameters->options().global())
+    flags |= elfcpp::DF_1_GLOBAL;
   if (parameters->options().initfirst())
     flags |= elfcpp::DF_1_INITFIRST;
   if (parameters->options().interpose())
index cf3b7056d22ee9f4d234e84314e42fee4515bfa2..6d827f187bc9e9ece153ad85caf3216c165da02d 100644 (file)
@@ -1272,6 +1272,9 @@ class General_options
              NULL);
   DEFINE_bool(execstack, options::DASH_Z, '\0', false,
              N_("Mark output as requiring executable stack"), NULL);
+  DEFINE_bool(global, options::DASH_Z, '\0', false,
+             N_("Make symbols in DSO available for subsequently loaded "
+                "objects"), NULL);
   DEFINE_bool(initfirst, options::DASH_Z, '\0', false,
              N_("Mark DSO to be initialized first at runtime"),
              NULL);