aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorDavid S. Miller <davem@redhat.com>2008-04-16 23:21:01 +0000
committerDavid S. Miller <davem@redhat.com>2008-04-16 23:21:01 +0000
commit7c41443585981fab8c7b9d375df49b9f8c779b5d (patch)
tree53a76409ab731fe4b602c6ac9d3f1bcb439adca7 /gold/layout.cc
parentdacec2a8bd47e90428f29f32d55ecb243e1d9ecd (diff)
downloadgdb-7c41443585981fab8c7b9d375df49b9f8c779b5d.zip
gdb-7c41443585981fab8c7b9d375df49b9f8c779b5d.tar.gz
gdb-7c41443585981fab8c7b9d375df49b9f8c779b5d.tar.bz2
elfcpp/
* elfcpp.h (DF_1_NOW, DF_1_GLOBAL, DF_1_GROUP, DF_1_NODELETE, DF_1_LOADFLTR, DF_1_INITFIRST, DF_1_NOOPEN, DF_1_ORIGIN, DF_1_DIRECT, DF_1_TRANS, DF_1_INTERPOSE, DF_1_NODEFLIB, DF_1_NODUMP, DF_1_CONLFAT): New enum constants. gold/ * options.h (DEFINE_enable): New macro. (new_dtags): New enable option. (initfirst, interpose, loadfltr, nodefaultlib, nodelete, nodlopen, nodump): New -z options. * layout.cc (Layout:finish_dynamic_section): If new dtags enabled, emit DT_RUNPATH. Also, emit a DT_FLAGS_1 containing any specified -z flags.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index 76b6b2b..fa0d4c8 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -2459,6 +2459,8 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
}
odyn->add_string(elfcpp::DT_RPATH, rpath_val);
+ if (parameters->options().enable_new_dtags())
+ odyn->add_string(elfcpp::DT_RUNPATH, rpath_val);
}
// Look for text segments that have dynamic relocations.
@@ -2509,6 +2511,28 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
if (parameters->options().shared() && this->has_static_tls())
flags |= elfcpp::DF_STATIC_TLS;
odyn->add_constant(elfcpp::DT_FLAGS, flags);
+
+ flags = 0;
+ if (parameters->options().initfirst())
+ flags |= elfcpp::DF_1_INITFIRST;
+ if (parameters->options().interpose())
+ flags |= elfcpp::DF_1_INTERPOSE;
+ if (parameters->options().loadfltr())
+ flags |= elfcpp::DF_1_LOADFLTR;
+ if (parameters->options().nodefaultlib())
+ flags |= elfcpp::DF_1_NODEFLIB;
+ if (parameters->options().nodelete())
+ flags |= elfcpp::DF_1_NODELETE;
+ if (parameters->options().nodlopen())
+ flags |= elfcpp::DF_1_NOOPEN;
+ if (parameters->options().nodump())
+ flags |= elfcpp::DF_1_NODUMP;
+ if (!parameters->options().shared())
+ flags &= ~(elfcpp::DF_1_INITFIRST
+ | elfcpp::DF_1_NODELETE
+ | elfcpp::DF_1_NOOPEN);
+ if (flags)
+ odyn->add_constant(elfcpp::DT_FLAGS_1, flags);
}
// The mapping of .gnu.linkonce section names to real section names.