and it is compiled by gcc on ARM in wrog little endian format
because you have not told gcc that it should generate code for ARM in big endian mode. Have you done that on purpose? I have shown how binaries of ARM look like depending on the compile options used. Have you ignored that post because it proves you wrong? Have you expected that after opcode "setend be" the binary will flip itself to big endian??
I believe that your compiler produces little endian by default, because almost everyone uses arm in little endian mode. But you can switch the compiler to produce big endian binary any time with proper command line options. Alternatively you can make entire toolchain with big endian as default und little endian as option.
With proper compiler flags the binary is correct:
Quote:
➜ grpc /opt/cross/bin/arm-linux-gnueabihf-gcc -mbe8 -mbig-endian -Wl,--be8 -Wl,--format=elf32-bigarm -nostartfiles -nostdlib -Os -o test test.c /opt/cross/lib/gcc/arm-linux-gnueabihf/8.2.0/../../../../arm-linux-gnueabihf/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000010094 ➜ grpc /opt/cross/bin/aarch64-linux-objcopy -O binary test test.bin ➜ grpc hexdump -C test.bin 00000000 04 30 9f e5 00 00 93 e5 1e ff 2f e1 00 02 00 a4 |.0......../.....| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00010010 de ad be ef |....| 00010014
Quote:
ARM is not real big endian cpu.
No, of course not. ARM is bi-endian CPU.
Quote:
It is useless for Amiga Os.
It is useful for AmigaOS when running in big endian mode.
Quote:
Old C/C++ Amiga code should work after just recompilation. Like on ppc.
With properly configured toolchain or with proper command line switches old C/C++ amiga code would work just after recompilation, like on ppc.