Commit | Line | Data |
---|---|---|
7e1edb90 ILT |
1 | // parameters.cc -- general parameters for a link using gold |
2 | ||
3 | #include "gold.h" | |
4 | ||
5 | #include "options.h" | |
6 | #include "parameters.h" | |
7 | ||
8 | namespace gold | |
9 | { | |
10 | ||
11 | // Initialize the parameters from the options. | |
12 | ||
13 | Parameters::Parameters(const General_options* options) | |
14 | : optimization_level_(options->optimization_level()) | |
15 | { | |
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; | |
22 | } | |
23 | ||
24 | // The global variable. | |
25 | ||
26 | const Parameters* parameters; | |
27 | ||
28 | // Initialize the global variable. | |
29 | ||
30 | void | |
31 | initialize_parameters(const General_options* options) | |
32 | { | |
33 | parameters = new Parameters(options); | |
34 | } | |
35 | ||
36 | } // End namespace gold. |