15 #include <unordered_set>
30 const std::string &filename,
50 return std::move(dest);
60 const std::string &filename,
83 message.
error() <<
"Failed to read header from '" << filename <<
"'"
90 if(hdr[0]==0x7f && hdr[1]==
'G' && hdr[2]==
'B' && hdr[3]==
'F')
93 in, filename, symbol_table, goto_functions, message_handler);
95 else if(hdr[0]==0x7f && hdr[1]==
'E' && hdr[2]==
'L' && hdr[3]==
'F')
108 in, filename, symbol_table, goto_functions, message_handler);
113 "failed to find goto-cc section in ELF binary" <<
messaget::eom;
129 if(osx_fat_reader.
has_gb())
132 if(osx_fat_reader.
extract_gb(filename, tempname()))
143 temp_in, filename, symbol_table, goto_functions, message_handler);
150 message.
error() <<
"failed to find goto binary in Mach-O file"
162 osx_mach_o_readert::sectionst::const_iterator entry =
163 mach_o_reader.
sections.find(
"goto-cc");
164 if(entry != mach_o_reader.
sections.end())
166 in.seekg(entry->second.offset);
168 in, filename, symbol_table, goto_functions, message_handler);
173 <<
"failed to find goto-cc section in Mach-O binary" <<
messaget::eom;
191 const std::string &filename,
212 if(hdr[0]==0x7f && hdr[1]==
'G' && hdr[2]==
'B' && hdr[3]==
'F')
216 else if(hdr[0]==0x7f && hdr[1]==
'E' && hdr[2]==
'L' && hdr[3]==
'F')
239 if(osx_fat_reader.
has_gb())
274 const std::string &file_name,
283 if(!temp_model.has_value())
308 const std::string &file_name,