x86/x86_64: Fix format warning with die()

Fedora koji uses gcc version 7.0.1-0.12.fc27, and it generates a build
warning

   kexec/arch/i386/kexec-elf-x86.c:299:3: error: format not a string
   literal and no format arguments [-Werror=format-security]
       die(error_msg);
       ^~~
    cc1: some warnings being treated as errors

error_msg can have a format specifier as well in string. In such cases,
if there is no other arguments for the format variable then code will
try to access a non existing argument. Therefore, use 1st argument as
format specifier for string print and pass error_msg as the string to be
printed.

While doing that,also use const qualifier before "char *error_msg".

Signed-off-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2 files changed