aboutsummaryrefslogtreecommitdiff
path: root/gold/parameters.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-09-21 07:20:01 +0000
committerIan Lance Taylor <iant@google.com>2007-09-21 07:20:01 +0000
commit7e1edb9089c4eec761d09d9bb0ce675eb0bcbc2b (patch)
tree8e9869d1fd6febfdfdc5e754ba12f36e899d9bb2 /gold/parameters.cc
parentbe9d5a933eb75809b583dc29bc7deb7690954d12 (diff)
downloadfsf-binutils-gdb-7e1edb9089c4eec761d09d9bb0ce675eb0bcbc2b.zip
fsf-binutils-gdb-7e1edb9089c4eec761d09d9bb0ce675eb0bcbc2b.tar.gz
fsf-binutils-gdb-7e1edb9089c4eec761d09d9bb0ce675eb0bcbc2b.tar.bz2
Add global parameters.
Diffstat (limited to 'gold/parameters.cc')
-rw-r--r--gold/parameters.cc36
1 files changed, 36 insertions, 0 deletions
diff --git a/gold/parameters.cc b/gold/parameters.cc
new file mode 100644
index 0000000..1780724
--- /dev/null
+++ b/gold/parameters.cc
@@ -0,0 +1,36 @@
+// parameters.cc -- general parameters for a link using gold
+
+#include "gold.h"
+
+#include "options.h"
+#include "parameters.h"
+
+namespace gold
+{
+
+// Initialize the parameters from the options.
+
+Parameters::Parameters(const General_options* options)
+ : optimization_level_(options->optimization_level())
+{
+ if (options->is_shared())
+ this->output_file_type_ = OUTPUT_SHARED;
+ else if (options->is_relocatable())
+ this->output_file_type_ = OUTPUT_OBJECT;
+ else
+ this->output_file_type_ = OUTPUT_EXECUTABLE;
+}
+
+// The global variable.
+
+const Parameters* parameters;
+
+// Initialize the global variable.
+
+void
+initialize_parameters(const General_options* options)
+{
+ parameters = new Parameters(options);
+}
+
+} // End namespace gold.