aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2010-01-07 18:16:24 +0000
committerIan Lance Taylor <ian@airs.com>2010-01-07 18:16:24 +0000
commitffeef7dfa55fe9608a46a991ce5413fe0db844f4 (patch)
tree468519c017f56d376bad9da8498abb1288aa11cd /gold/layout.cc
parentb7cd1872af07e11e50368d40505ef8b57e192bcc (diff)
downloadgdb-ffeef7dfa55fe9608a46a991ce5413fe0db844f4.zip
gdb-ffeef7dfa55fe9608a46a991ce5413fe0db844f4.tar.gz
gdb-ffeef7dfa55fe9608a46a991ce5413fe0db844f4.tar.bz2
* options.h (class General_options): Add -z text and -z textoff.
* layout.cc (Layout::finish_dynamic_section): Implement -z text.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index f427af5..9f51e82 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -3353,8 +3353,10 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
odyn->add_constant(elfcpp::DT_TEXTREL, 0);
flags |= elfcpp::DF_TEXTREL;
- if (parameters->options().warn_shared_textrel()
- && parameters->options().shared())
+ if (parameters->options().text())
+ gold_error(_("read-only segment has dynamic relocations"));
+ else 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())