Vector35 / Vector35/binaryninja-api

Need to handle R_MIPS_TLS_* MIPS64 relocations properly

Open
#5,876 1 comment 0 reactions 1 assignee View on GitHub

@galenbwill is already working on this.

Since Nov 6, 2024.

Arch: MIPS Component: Architecture Impact: Medium
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

What is the feature you'd like to have?
Currently, in MIPS64, we don't handle MIPS64-specific relocations properly. They appear to be non-standard and are built out of three separate relocations (see the comment and structs here in the gdb source). If I'm understanding this right, a relocation of 4611 should be something like (R_MIPS_64 << 8) | R_MIPS_REL32 | 3 = 4611

Is your feature request related to a problem?
Binaries like this libc from a router that uses a Cavium OCTEON processor (libc-2.9.so.zip) report multiple relocations that are not recognized. It's unclear to me at this point how impactful these are on analysis, but the fact that we don't handle any of the MIPS64 relocations is likely problematic in at least some limited scenarios.

UPDATE
As of 4.2 stable release, we now handle all the relocation types mentioned in this issue except for the Thread Local Storage-related relocations (R_MIPS_TLS_*).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.