Skip to content

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

Description

@ilyakurdyukov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions