5 #ifndef CPROVER_GOTO_CC_LINKER_SCRIPT_MERGE_H
6 #define CPROVER_GOTO_CC_LINKER_SCRIPT_MERGE_H
33 const std::function<
bool(
const exprt &)>
match)
109 std::list<irep_idt> &linker_defined_symbols,
111 const std::string &out_file,
112 const std::string &def_out_file);
124 const std::string &linker_script,
171 std::list<symbol_exprt> &to_pointerize,
180 const std::string &shape);
186 std::list<symbol_exprt> &to_pointerize)
const;
201 const std::list<irep_idt> &linker_defined_symbols,
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
Synthesise definitions of symbols that are defined in linker scripts.
linker_script_merget(const std::string &elf_binary, const std::string &goto_binary, const cmdlinet &, message_handlert &)
int pointerize_linker_defined_symbols(goto_modelt &, const linker_valuest &)
convert the type of linker script-defined symbols to char*
void symbols_to_pointerize(const linker_valuest &linker_values, const exprt &expr, std::list< symbol_exprt > &to_pointerize) const
fill to_pointerize with names of linker symbols appearing in expr
int add_linker_script_definitions()
Add values of linkerscript-defined symbols to the goto-binary.
const std::string & elf_binary
int get_linker_script_data(std::list< irep_idt > &linker_defined_symbols, const symbol_tablet &symbol_table, const std::string &out_file, const std::string &def_out_file)
Write linker script definitions to linker_data.
std::map< irep_idt, std::pair< symbol_exprt, exprt > > linker_valuest
int goto_and_object_mismatch(const std::list< irep_idt > &linker_defined_symbols, linker_valuest &linker_values)
one-to-one correspondence between extern & linker symbols
int ls_data2instructions(jsont &data, const std::string &linker_script, symbol_tablet &symbol_table, linker_valuest &linker_values)
Write a list of definitions derived from data into the symbol_table.
int pointerize_subexprs_of(exprt &expr, std::list< symbol_exprt > &to_pointerize, const linker_valuest &linker_values)
std::list< replacement_predicatet > replacement_predicates
The "shapes" of expressions to be replaced by a pointer.
int replace_expr(exprt &old_expr, const linker_valuest &linker_values, const symbol_exprt &old_symbol, const irep_idt &ident, const std::string &shape)
do the actual replacement of an expr with a new pointer expr
int linker_data_is_malformed(const jsont &data) const
Validate output of the scripts/ls_parse.py tool.
const std::string & goto_binary
Class that provides messages with a built-in verbosity 'level'.
Patterns of expressions that should be replaced.
bool match(const exprt &expr) const
Predicate: does the given expression match an interesting pattern?
std::function< const symbol_exprt &(const exprt &)> _inner_symbol
std::function< bool(const exprt &)> _match
const symbol_exprt & inner_symbol(const exprt &expr) const
Return the underlying symbol of the matched expression.
replacement_predicatet(const std::string &description, const std::function< const symbol_exprt &(const exprt &)> inner_symbol, const std::function< bool(const exprt &)> match)
const std::string & description() const
a textual description of the expression that we're trying to match
Expression to hold a symbol (variable)