LTO: display file name if LTO version check fails

* lto-section-in.c (lto_get_section_data): Call
	lto_check_version with additional argument.
	* lto-streamer.c (lto_check_version): Add new argument.
	* lto-streamer.h (lto_check_version): Likewise.

From-SVN: r236464
This commit is contained in:
Martin Liska 2016-05-19 17:02:30 +02:00 committed by Martin Liska
parent f65970cfd0
commit b898d037f3
4 changed files with 14 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2016-05-19 Martin Liska <mliska@suse.cz>
* lto-section-in.c (lto_get_section_data): Call
lto_check_version with additional argument.
* lto-streamer.c (lto_check_version): Add new argument.
* lto-streamer.h (lto_check_version): Likewise.
2016-05-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com> 2016-05-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/arm.c (arm_new_rtx_costs, SIGN_EXTEND case): * config/arm/arm.c (arm_new_rtx_costs, SIGN_EXTEND case):

View File

@ -168,7 +168,8 @@ lto_get_section_data (struct lto_file_decl_data *file_data,
} }
lto_check_version (((const lto_header *)data)->major_version, lto_check_version (((const lto_header *)data)->major_version,
((const lto_header *)data)->minor_version); ((const lto_header *)data)->minor_version,
file_data->file_name);
return data; return data;
} }

View File

@ -376,12 +376,13 @@ lto_orig_address_remove (tree t)
/* Check that the version MAJOR.MINOR is the correct version number. */ /* Check that the version MAJOR.MINOR is the correct version number. */
void void
lto_check_version (int major, int minor) lto_check_version (int major, int minor, const char *file_name)
{ {
if (major != LTO_major_version || minor != LTO_minor_version) if (major != LTO_major_version || minor != LTO_minor_version)
fatal_error (input_location, fatal_error (input_location,
"bytecode stream generated with LTO version %d.%d instead " "bytecode stream in file '%s' generated with LTO version "
"of the expected %d.%d", "%d.%d instead of the expected %d.%d",
file_name,
major, minor, major, minor,
LTO_major_version, LTO_minor_version); LTO_major_version, LTO_minor_version);
} }

View File

@ -844,7 +844,7 @@ extern void lto_orig_address_map (tree, intptr_t);
extern intptr_t lto_orig_address_get (tree); extern intptr_t lto_orig_address_get (tree);
extern void lto_orig_address_remove (tree); extern void lto_orig_address_remove (tree);
#endif #endif
extern void lto_check_version (int, int); extern void lto_check_version (int, int, const char *);
extern void lto_streamer_hooks_init (void); extern void lto_streamer_hooks_init (void);
/* In lto-streamer-in.c */ /* In lto-streamer-in.c */