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 .gnu_debuglink DWARF5 Section #525

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

io-no
Copy link

@io-no io-no commented Dec 1, 2023

Address #523

I've added support for the .gnu_debuglink section in DWARF5 and made it compliant with the follow_links option. This involved modifying the DWARFInfo constructor to include the new section and creating a new structure in structs.py.

Then, I ran all the tests and updated test/test_refaddr_bitness.py to align with the changes in the constructor structure. All tests were executed successfully.

@sevaa
Copy link
Contributor

sevaa commented Dec 1, 2023

The PR looks good. We'd like a test binary, though.

Good point re: the bitness test. It was my doing; I observed the issue on a MachO binary and made a test out of that instead of trying to reproduce on an ELF one. I'll try to supply a less fragile test.

The purpose of gnu_debuglink and gnu_debugaltlink looks, well, identical. Do you know why both exist?

Looks like you ignore the padding and the checksum altogether. It's OK to not parse the section to the very end, you know :)

@io-no
Copy link
Author

io-no commented Dec 13, 2023

Hi, I've added a test as requested. I tried to keep the structure and format consistent with the other tests, I hope it's okay.

Regarding the differences between the two sections, I admit that it remains a bit unclear to me as well. From what I understand, the .gnu_debugaltlink section is related to the use of tools such as dwz and is not really part of the standard, unlike .gnu_debuglink which is part of the standard.

I parsed padding and checksum for consistency with what I saw for the implementation of the .gnu_debugaltlink section. No, I don't use them. It might be an idea to use the checksum for future implementations where, in addition to opening the external file, its integrity is also verified. In the meantime, if you prefer, I can also ignore those two fields.

@davea42
Copy link

davea42 commented Dec 14, 2023 via email

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.

None yet

3 participants