aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2010-01-07 06:05:23 +0000
committerIan Lance Taylor <ian@airs.com>2010-01-07 06:05:23 +0000
commitb9674e179b86530631391dd38988d2f5da4f40c0 (patch)
tree1c3ab467c6dff839f4773c0a0a8cefadc2e34e25 /gold/layout.cc
parent6eda8c29b846c5140c023e21c931c3a97ddf62fc (diff)
downloadgdb-b9674e179b86530631391dd38988d2f5da4f40c0.zip
gdb-b9674e179b86530631391dd38988d2f5da4f40c0.tar.gz
gdb-b9674e179b86530631391dd38988d2f5da4f40c0.tar.bz2
PR 10980
* options.h (class General_options): Add --warn-shared-textrel. * layout.cc (Layout::finish_dynamic_section): Implement --warn-shared-textrel.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index 13c7f7e..f3deb9a 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -3355,6 +3355,10 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
// Add a DT_TEXTREL for compatibility with older loaders.
odyn->add_constant(elfcpp::DT_TEXTREL, 0);
flags |= elfcpp::DF_TEXTREL;
+
+ if (parameters->options().warn_shared_textrel()
+ && parameters->options().shared())
+ gold_warning(_("shared library text segment is not shareable"));
}
if (parameters->options().shared() && this->has_static_tls())
flags |= elfcpp::DF_STATIC_TLS;