Add little-endian octeon mips arch#8171
Open
jonathanzetier wants to merge 1 commit into
Open
Conversation
fuzyll
approved these changes
Jun 3, 2026
Contributor
fuzyll
left a comment
There was a problem hiding this comment.
I've been working on a thing in the background for awhile that lets me generate binaries of different architecture/platform combos and I can confirm that this makes a sample binary that does return 0; go from:
004004b0 int64_t main(int64_t, int64_t, int64_t, int64_t arg4, int32_t arg5 @ $t7)
int64_t arg4 {Register $a3}
int32_t arg5 {Register $t7}
004004b0 0 f0ffbd67 scd $ra, -0x4299($a3) {0x1} {0x0}
❓004004b4 0 0800beff j 0x2fbfc
004004b8 0 25f0a003 addiu $s0, $t7, -0x5ffd
...to:
004004b0 int64_t main() __pure
void var_10 {Frame offset -10}
int64_t __saved_$fp {Frame offset -8}
void arg_0 {Frame offset 0}
004004b0 0* f0ffbd67 daddiu $sp, $sp, -0x10
004004b4 10 0800beff sd $fp, 8($sp) {__saved_$fp}
004004b8 10 25f0a003 move $fp, $sp {var_10}
004004bc 10 25100000 move $v0, $zero {0x0}
004004c0 10 25e8c003 move $sp, $fp
004004c4 10 0800bedf ld $fp, 8($sp) {__saved_$fp}
004004c8 10* 1000bd67 daddiu $sp, $sp, 0x10
004004cc 0 0800e003 jr $ra
004004d0 0 00000000 nop
Which, as far as I can tell, means we've gone from "not real code" to "real code". Seems like an obvious win to me.
Will get this merged as soon as I can. 😄
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I didn't think these actually existed in the wild, but lo and behold, we have stumbled upon a little-endian cavium mips64 ELF. Unfortunately I can't share it, but I can confirm that this properly disassembles the binary we discovered, whereas before, it would be appear as total garbage because it was trying to decode little-endian MIPS as big-endian.
I'm pretty sure I added the little-endian variant everywhere that had the big-endian variant, but please double-check and let me know if there's somewhere I missed!