binaryninja-api
binaryninja-api copied to clipboard
aarch64 Big-Endian data mode doesn't handle relocations in big endian
Version and Platform (required):
- Binary Ninja Version: 4.1.5213-dev
- OS: macOS
- OS Version: 14
- CPU Architecture: M1
Bug Description: When opening an aarch64/big endian data mode file, while the lifter totally handles the big endian loads correctly, the relocations are written as little endian and appear backwards as a result.
Steps To Reproduce:
- Open this aarch64be file from dogbolt: fe62aea37a48c3836cdf5c8431ba155988f375f5cdac062f36d4e6da66ff3165.zip
- Navigate to 0x410df0
- Observe all the addresses are byte swapped
- Check the bytes in hex view (ELF) vs hex view (Raw) and see that the ELF bytes are swapped
Expected Behavior: I expected the relocations to be applied correctly.
Screenshots:
Additional Information: Apparently aarch64be is totally a file format, it's only big endian for data accesses, not instructions. Very cursed.