Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Little-endian or1k in binutils is unavailable or severely broken. #8

Open
ilyakurdyukov opened this issue Dec 7, 2023 · 0 comments

Comments

@ilyakurdyukov
Copy link

In some files I found that theoretically binutils supports little-endian OpenRISC, but I can't get the assembler to compile in little-endian format, there's simply no such option for or1k!

I can ask objdump to disassemble in little-endian format, but then half the instructions are broken:

objdump -D -b binary -EB -m or1k test_be.bin

   0:	18 60 07 27 	l.movhi r3,0x727
   4:	a8 63 0e 00 	l.ori r3,r3,0xe00
   8:	9c 63 ff ff 	l.addi r3,r3,-1
   c:	bc 43 00 00 	l.sfgtui r3,0
  10:	13 ff ff fe 	l.bf 0x8
  14:	44 00 48 00 	l.jr r9

objdump -D -b binary -EL -m or1k test_le.bin

   0:	27 07 60 18 	*unknown*
   4:	00 0e 63 a8 	l.ori r3,r3,0xe00
   8:	ff ff 63 9c 	*unknown*
   c:	00 00 43 bc 	l.sfgtui r3,0
  10:	fe ff ff 13 	*unknown*
  14:	00 48 00 44 	l.jr r9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant