1#ifndef MODULE_COLLECTOR_H
2#define MODULE_COLLECTOR_H
9#include "symbol_definition.h"
10#include "table_section.h"
32 void SetupOptions(
char special_char, std::shared_ptr<OutputFormat> output_format);
36 std::shared_ptr<Module> CreateModule(std::shared_ptr<const InputFormat> input_format, std::string file_name =
"");
39 char special_prefix_char =
'$';
40 std::weak_ptr<OutputFormat> output_format;
49 std::weak_ptr<Module>
module;
52 std::vector<std::shared_ptr<Module>>
modules;
71 void AddModule(std::shared_ptr<Module> module,
bool is_library =
false);
85 void IncludeModule(std::shared_ptr<Module> module);
Helper class that collects object files and libraries, and includes library objects for required symb...
Definition module_collector.h:25
std::vector< std::shared_ptr< Module > > modules
A list of all modules to be considered, not all of which will be included in the final generated bina...
Definition module_collector.h:52
std::set< std::string > required_symbols
Symbols that are referenced but have not yet been defined among the included modules.
Definition module_collector.h:58
void CombineModulesInto(Module &output_module)
Appends all the modules that have been determined to be included, into a resulting object.
Definition module_collector.cc:82
void SetupOptions(char special_char, std::shared_ptr< OutputFormat > output_format)
Initializes the reader for linking purposes.
Definition module_collector.cc:8
bool generate_got
Set to true when Global Offset Table generation is requested.
Definition module_collector.h:35
void AddModule(std::shared_ptr< Module > module, bool is_library=false)
Adds a module to the modules vector, also registers all the non-local symbols, and determines if any ...
Definition module_collector.cc:21
void AddLibraryModule(std::shared_ptr< Module > module)
Convenience method to add a library.
Definition module_collector.cc:77
std::map< std::string, definition > symbol_definitions
Collection of symbols defined thus far.
Definition module_collector.h:64
Encodes an object module file as a collection of sections, symbols and relocations.
Definition module.h:24
binding_type
Definition symbol_definition.h:20
Description of a symbol definition in some module.
Definition module_collector.h:45
SymbolDefinition::binding_type binding
The binding type of the symbol where it is defined.
Definition module_collector.h:47