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

feat(sabsptr): support for DW_EH_PE_sabsptr #185

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexkozy
Copy link

When I run bloaty against my binary I got "bloaty: Unexpected
eh_frame format value: 8" error.
According documentation libobjc2 I can interpret this value as
signed version of DW_EH_PE_abstr.
After further research I found that this library has strange handling
for such values [2] and it mentions something about GCC extension.

It looks like this value should be returned as is, at least when
current logic tries to translate it by calling TranslateVMToFile,
this calls fails.

When this value is returned as is it looks like I am getting quite
valid output for my binary.

It might fix #141

[1] https://github.com/gnustep/libobjc2/blob/master/dwarf_eh.h#L23
[2] https://github.com/gnustep/libobjc2/blob/master/dwarf_eh.h#L200

When I run bloaty against my binary I got "bloaty: Unexpected
eh_frame format value: 8" error.
According documentation libobjc2 I can interpret this value as
signed version of DW_EH_PE_abstr.
After further research I found that this library has strange handling
for such values [2] and it mentions something about GCC extension.

It looks like this value should be returned as is, at least when
current logic tries to translate it by calling TranslateVMToFile,
this calls fails.

When this value is returned as is it looks like I am getting quite
valid output for my binary.

It might fix google#141

[1] https://github.com/gnustep/libobjc2/blob/master/dwarf_eh.h#L23
[2] https://github.com/gnustep/libobjc2/blob/master/dwarf_eh.h#L200
@haberman
Copy link
Member

Thanks for the patch!

An initial comment: from what I can see, this constant is usually represented as a flag called DW_EH_PE_signed, not a distinct value, see:

https://github.com/gnustep/libobjc2/blob/master/dwarf_eh.h#L24
https://code.woboq.org/gcc/libgcc/unwind-pe.h.html#_M/DW_EH_PE_signed

I'll have to dig in a bit more about skipping the translation.

@haberman
Copy link
Member

Ping @ak239?

@alexkozy
Copy link
Author

Sorry, I missed a ping. It looks like this DW_EH_PE_sabsptr is a DW_EH_PE_signed | DW_EH_PE_absptr, so I can introduce a flag but it looks like I would need some value that presents signed absptr value (which by itself sounds to me a little bit strange).

@xorz57
Copy link

xorz57 commented Sep 27, 2024

Is anyone working on this?

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.

bloaty: Unexpected eh_frame format value: 8
3 participants