aboutsummaryrefslogtreecommitdiff
path: root/gold/parameters.cc
blob: 1780724576fe03c02da7f6d4c0b1d3b38f0a3592 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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.