mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2024-12-13 23:29:03 +00:00
37 lines
741 B
C++
37 lines
741 B
C++
|
// 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.
|