aboutsummaryrefslogtreecommitdiff
path: root/gold/parameters.cc
diff options
context:
space:
mode:
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.