15 #include <unordered_set> 37 const std::string &filename,
60 return std::move(dest);
70 const std::string &filename,
84 message.
error() <<
"Failed to open `" << filename <<
"'" 96 if(hdr[0]==0x7f && hdr[1]==
'G' && hdr[2]==
'B' && hdr[3]==
'F')
99 in, filename, symbol_table, goto_functions, message_handler);
101 else if(hdr[0]==0x7f && hdr[1]==
'E' && hdr[2]==
'L' && hdr[3]==
'F')
114 in, filename, symbol_table, goto_functions, message_handler);
119 "failed to find goto-cc section in ELF binary" <<
messaget::eom;
135 if(osx_fat_reader.
has_gb())
138 if(osx_fat_reader.
extract_gb(filename, tempname()))
149 temp_in, filename, symbol_table, goto_functions, message_handler);
156 message.
error() <<
"failed to find goto binary in Mach-O file" 189 if(hdr[0]==0x7f && hdr[1]==
'G' && hdr[2]==
'B' && hdr[3]==
'F')
193 else if(hdr[0]==0x7f && hdr[1]==
'E' && hdr[2]==
'L' && hdr[3]==
'F')
216 if(osx_fat_reader.
has_gb())
235 const std::string &file_name,
273 const std::string &file_name,
bool has_section(const std::string &name) const
std::wstring widen(const char *s)
bool is_goto_binary(const std::string &filename)
symbol_tablet symbol_table
Symbol table.
std::string section_name(std::size_t index) const
bool read_goto_binary(const std::string &filename, goto_modelt &dest, message_handlert &message_handler)
Read a goto binary from a file, but do not update config.
void link_goto_model(goto_modelt &dest, goto_modelt &src, message_handlert &message_handler)
bool extract_gb(const std::string &source, const std::string &dest) const
std::streampos section_offset(std::size_t index) const
void swap(goto_functionst &other)
nonstd::optional< T > optionalt
A collection of goto functions.
Class that provides messages with a built-in verbosity 'level'.
void set_from_symbol_table(const symbol_tablet &)
bool read_bin_goto_object(std::istream &in, const std::string &filename, symbol_tablet &symbol_table, goto_functionst &functions, message_handlert &message_handler)
reads a goto binary file back into a symbol and a function table
bool is_osx_fat_magic(char hdr[4])
static std::string binary(const constant_exprt &src)
std::size_t number_of_sections
void swap(symbol_tablet &other)
Swap symbol maps between two symbol tables.
bool read_object_and_link(const std::string &file_name, goto_modelt &dest, message_handlert &message_handler)
reads an object file, and also updates config
goto_functionst goto_functions
GOTO functions.
mstreamt & statistics() const