On 6/3/25 08:28, Thomas Huth wrote:
On 05/03/2025 16.39, Philippe Mathieu-Daudé wrote:
Introduce legacy_binary_endianness() to return the endianness
of a legacy binary, and legacy_binary_is_big_endian() being
equivalent of compile time TARGET_BIG_ENDIAN definition.
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
include/qemu/legacy_binary_info.h | 8 ++++++
legacy_binary_info.c | 43 +++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+)
We already have target_words_bigendian() ... why do we need yet another
function?
target_words_bigendian() depends on a compile time constant that we want
to get rid of: TARGET_BIG_ENDIAN.
Also, since vCPUs can be configured in different endianness, both the
method and definition are misleading, what they mean is "the *binary*
uses BIG endianness by default".
For example we can now build a TARGET_BIG_ENDIAN microblaze binary
with all vCPU core instantiated in little endianness.
Since unified binary won't have particular endianness knowledge
(still, machines will), I suggest:
target_words_bigendian() -> qemu_legacy_binary_is_bigendian()