binutils-gdb/cpu
Stafford Horne 7a23d8a826 or1k: Fix disassembly for little-endian binaries
There are some OpenRISC CPUs that have their binaries stored in
little-endian format.  Using objdump to disassemble these is
problematic, as some instructions fail to disassemble, for example:

    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

It was found that the hash function was using the still little-endian
buffer to extract the opcode used for the hash lookup.  This didn't work
as it was pulling the wrong hashcode causing instruction lookup to fail.

Fix the hash function by using the normalized/byte-swapped value instead
of the buffer.

Signed-off-by: Stafford Horne <shorne@gmail.com>
2025-06-21 05:46:12 +01:00
..
ChangeLog Add markers for bihnutils 2.44 branch 2025-01-19 12:09:01 +00:00
cris.cpu sim: cris: change temp var name slightly to avoid shadowing 2024-01-06 23:30:43 -05:00
epiphany.cpu Remove more shifts for sign/zero extension 2019-12-11 21:14:19 +10:30
epiphany.opc epiphany/disassembler: Improve alignment of output. 2016-02-02 11:09:17 +00:00
fr30.cpu ubsan: fr30: left shift of negative value 2020-01-13 12:12:05 +10:30
fr30.opc
frv.cpu sim: frv: fix -Wincompatible-function-pointer-types warnings [PR sim/29752] 2024-01-22 20:12:08 -05:00
frv.opc Use bool in opcodes 2021-03-31 10:49:23 +10:30
ip2k.cpu
ip2k.opc
iq10.cpu
iq2000.cpu sim --enable-cgen-maint 2023-08-19 12:41:32 +09:30
iq2000.opc
iq2000m.cpu
lm32.cpu Remove more shifts for sign/zero extension 2019-12-11 21:14:19 +10:30
lm32.opc
m32c.cpu ubsan: m32c: left shift of negative value 2020-02-03 15:59:08 +10:30
m32c.opc
m32r.cpu Fix spelling mistakes 2020-10-05 14:20:15 +01:00
m32r.opc
mep-avc.cpu
mep-avc2.cpu
mep-c5.cpu
mep-core.cpu mep: ubsan: mep-ibld.c:1635,1645,1652 left shift of negative value 2020-09-01 16:03:08 +09:30
mep-default.cpu
mep-ext-cop.cpu
mep-fmax.cpu
mep-h1.cpu
mep-ivc2.cpu
mep-rhcop.cpu
mep-sample-ucidsp.cpu
mep.cpu
mep.opc PR21739, Inconsistent diagnostics 2024-02-29 21:07:04 +10:30
mt.cpu
mt.opc opcodes cgen: remove use of PTR 2022-05-11 09:49:20 +09:30
or1k.cpu or1k: Remove 64-bit support, it's not used and it breaks 32-bit hosts 2020-05-19 20:40:27 +09:00
or1k.opc or1k: Fix disassembly for little-endian binaries 2025-06-21 05:46:12 +01:00
or1kcommon.cpu or1k: Add support for numcores and coreid sprs 2025-06-14 06:10:57 +01:00
or1korbis.cpu cpu: or1k: drop unused l.swa flag 2024-01-01 10:51:23 -05:00
or1korfpx.cpu or1k: Remove 64-bit support, it's not used and it breaks 32-bit hosts 2020-05-19 20:40:27 +09:00
sh.cpu
sh.opc
sh64-compact.cpu
sh64-media.cpu
simplify.inc
xstormy16.cpu ubsan: xstormy16: left shift of negative value 2019-12-16 17:35:13 +10:30
xstormy16.opc