summaryrefslogtreecommitdiff
path: root/gold/parameters.cc
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2013-07-19 23:07:08 +0000
committerRoland McGrath <roland@gnu.org>2013-07-19 23:07:08 +0000
commita3ed37d8bcb97329ff3acebba63c754d153d3363 (patch)
tree5808e3e5905998fac75b21690ff89878e316c35c /gold/parameters.cc
parent69091a2cc4cfdd51d5b63c2925ab50ba6aa094cf (diff)
downloadbinutils-gdb-a3ed37d8bcb97329ff3acebba63c754d153d3363.tar.gz
gold/
* options.h (General_options): Add -Trodata-segment option. * parameters.cc (Parameters::check_rodata_segment): New function. (Parameters::set_target_once): Call it. * parameters.h (Parameters): Declare it (private member function). * layout.cc (load_seg_unusable_for_headers): New function, broken out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr() then validate rodata segment rather than text segment. (relaxation_loop_body): Call that. (is_text_segment): New function. Don't admit a non-executable segment if TARGET->isolate_execinstr(). (set_segment_offsets): Call it. Honor -Trodata-segment option.
Diffstat (limited to 'gold/parameters.cc')
-rw-r--r--gold/parameters.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/gold/parameters.cc b/gold/parameters.cc
index d69b62c1430..27819908fe1 100644
--- a/gold/parameters.cc
+++ b/gold/parameters.cc
@@ -1,6 +1,6 @@
// parameters.cc -- general parameters for a link using gold
-// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012
+// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
// Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
@@ -127,7 +127,10 @@ Parameters::set_target_once(Target* target)
gold_assert(this->target_ == NULL);
this->target_ = target;
if (this->options_valid())
- this->check_target_endianness();
+ {
+ this->check_target_endianness();
+ this->check_rodata_segment();
+ }
}
// Clear the target, for testing.
@@ -219,6 +222,15 @@ Parameters::check_target_endianness()
}
}
+void
+Parameters::check_rodata_segment()
+{
+ if (this->options().user_set_Trodata_segment()
+ && !this->options().rosegment()
+ && !this->target().isolate_execinstr())
+ gold_error(_("-Trodata-segment is meaningless without --rosegment"));
+}
+
// Return the name of the entry symbol.
const char*