Currently, file2hex.py supports conversion of binary data into hexadecimal
character list format only. The generated list can then be used to embed
the binary data by using the list to initialize an array. However, this
approach is highly inefficient for large binary files.
A close but considerably more efficient alternative is to use string
literals composed of hex characters (in escaped form) to initialize the
array, instead of an initializer list. Benchmarking (with GCC and clang)
indicates that compile time and host memory usage by the compiler can be
more than an order of magnitude less with string literal approach compared
to the initializer list form.
The only caveat is that string literals contain the null character as
terminator so where accurate length is required, the correct length must
be specified explicitly while defining the array.
Signed-off-by: Irfan Ahmad <irfan.ahmad@siemens.com>