daily update
[binutils.git] / gold / parameters.cc
blob1780724576fe03c02da7f6d4c0b1d3b38f0a3592
1 // parameters.cc -- general parameters for a link using gold
3 #include "gold.h"
5 #include "options.h"
6 #include "parameters.h"
8 namespace gold
11 // Initialize the parameters from the options.
13 Parameters::Parameters(const General_options* options)
14 : optimization_level_(options->optimization_level())
16 if (options->is_shared())
17 this->output_file_type_ = OUTPUT_SHARED;
18 else if (options->is_relocatable())
19 this->output_file_type_ = OUTPUT_OBJECT;
20 else
21 this->output_file_type_ = OUTPUT_EXECUTABLE;
24 // The global variable.
26 const Parameters* parameters;
28 // Initialize the global variable.
30 void
31 initialize_parameters(const General_options* options)
33 parameters = new Parameters(options);
36 } // End namespace gold.