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

Xtensa relocation: some types not implemented #7341

Open
redfast00 opened this issue Jan 2, 2025 · 3 comments
Open

Xtensa relocation: some types not implemented #7341

redfast00 opened this issue Jan 2, 2025 · 3 comments

Comments

@redfast00
Copy link
Contributor

redfast00 commented Jan 2, 2025

I'm currently reverse engineering the ESP32 wifi and phy binary blobs (see also https://github.com/esp32-open-mac/ and the 38c3 talk about this https://media.ccc.de/v/38c3-liberating-wi-fi-on-the-esp32). They have some relocation types that are not currently handled:

  • R_XTENSA_SLOT0_OP
  • R_XTENSA_32 (apparently already implement, my bad, I was running an old version)
  • R_XTENSA_ASM_EXPAND

It appears that the Linux kernel contains an implementation of these (https://github.com/torvalds/linux/blob/56e6a3499e14716b9a28a307bb6d18c10e95301e/arch/xtensa/kernel/module.c#L77); it would be nice if at least the three missing relocation types could be implemented.

@redfast00
Copy link
Contributor Author

(related to #6138)

@mumbel I saw that you worked on other Xtensa relocations; thank you for that :D would you be willing to work on the other relocation types that are currently unimplemented?

@mumbel
Copy link
Contributor

mumbel commented Jan 2, 2025

R_XTENSA_SLOT{0..14}_OP and R_XTENSA_ASM_EXPAND can probably be ignored and marked as SKIPPED.

doing some of the relocations (this is probably true on many/all arch) on unlinked .a files is just weird/impossible for this kind of analysis

Did you notice issues or just saw the bookmarks/prints that they were not supported (specific binary and address if so, i dont mind taking a look)?
but looking at https://github.com/jcmvbkbc/xtensa-abi/blob/master/relocations
they appear to be no-op, so ld would fix them while linking most likely and I think they should just be correct as is for ghidra.

@redfast00
Copy link
Contributor Author

I noticed the warning that some relocations were missing; I thought it might be better to work on the unlinked file instead of the linked file (this is what I was doing before).

Here's the file: libphy.a.zip

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

2 participants