@@ -126,7 +126,9 @@ enum class file_typet
126
126
ELF_OBJECT
127
127
};
128
128
129
- static file_typet detect_file_type (const std::string &file_name)
129
+ static file_typet detect_file_type (
130
+ const std::string &file_name,
131
+ message_handlert &message_handler)
130
132
{
131
133
// first of all, try to open the file
132
134
std::ifstream in (file_name);
@@ -154,7 +156,7 @@ static file_typet detect_file_type(const std::string &file_name)
154
156
if (ext == " a" )
155
157
return file_typet::NORMAL_ARCHIVE;
156
158
157
- if (is_goto_binary (file_name))
159
+ if (is_goto_binary (file_name, message_handler ))
158
160
return file_typet::GOTO_BINARY;
159
161
160
162
if (hdr[0 ] == 0x7f && memcmp (hdr + 1 , " ELF" , 3 ) == 0 )
@@ -167,7 +169,7 @@ static file_typet detect_file_type(const std::string &file_name)
167
169
// / \return false on success, true on error.
168
170
bool compilet::add_input_file (const std::string &file_name)
169
171
{
170
- switch (detect_file_type (file_name))
172
+ switch (detect_file_type (file_name, get_message_handler () ))
171
173
{
172
174
case file_typet::FAILED_TO_OPEN_FILE:
173
175
warning () << " failed to open file `" << file_name
@@ -249,7 +251,7 @@ bool compilet::add_files_from_archive(
249
251
{
250
252
std::string t = concat_dir_file (tstr, line);
251
253
252
- if (is_goto_binary (t))
254
+ if (is_goto_binary (t, get_message_handler () ))
253
255
object_files.push_back (t);
254
256
else
255
257
debug () << " Object file is not a goto binary: " << line << eom;
@@ -280,7 +282,7 @@ bool compilet::find_library(const std::string &name)
280
282
{
281
283
library_file_name = concat_dir_file (library_path, " lib" + name + " .so" );
282
284
283
- switch (detect_file_type (library_file_name))
285
+ switch (detect_file_type (library_file_name, get_message_handler () ))
284
286
{
285
287
case file_typet::GOTO_BINARY:
286
288
return !add_input_file (library_file_name);
0 commit comments