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

Support for XC16/PIC phantom bytes #522

Merged
merged 2 commits into from
Dec 8, 2023
Merged

Conversation

sevaa
Copy link
Contributor

@sevaa sevaa commented Nov 20, 2023

Addresses #518 and #473.

This is a weird flavor of DWARF, emitted by the XC16 compiler for PIC microcontrollers, that looks completely alien on its face but can be trivially supported if one discards every odd numbered byte ("phantom bytes") in every DWARF section.

We don't know where does this transform fit between two decompression hooks and relocations. Relocations are explicitly shorted out for now, the compression logic is left as-is, seeing as the compiler doesn't seem to support it.

This peculiarity adds nothing to the format of DWARF proper, it can be seen as merely an unusual way to store DWARF data in the binary. So a case for a proper readelf test is not as strong as I originally thought; a unit test with an XC16/PIC binary should suffice. Before the patch, parsing those binaries would crash on the first CU accessing call.

@eliben eliben merged commit 47eea55 into eliben:master Dec 8, 2023
3 checks passed
@sevaa sevaa deleted the feat_phantombytes branch April 15, 2024 14:02
@sevaa sevaa restored the feat_phantombytes branch April 15, 2024 16:23
@sevaa sevaa deleted the feat_phantombytes branch April 15, 2024 16:24
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

Successfully merging this pull request may close these issues.

2 participants