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

elf: fix parsing of symtab from viv data #1721

Merged
merged 4 commits into from
Aug 14, 2023
Merged

Conversation

williballenthin
Copy link
Collaborator

closes #1704

also cleans up naming and type hints

Checklist

  • No CHANGELOG update needed
  • No new tests needed
  • No documentation update needed

@williballenthin williballenthin added the bug Something isn't working label Aug 14, 2023
def from_Elf(cls, ElfBinary) -> Optional["SymTab"]:
endian = "<" if ElfBinary.getEndian() == 0 else ">"
bitness = ElfBinary.bits
def from_viv(cls, elf: Elf.Elf) -> Optional["SymTab"]:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated:

  • name for consistency
  • parameter name for pep8 (lowercase)
  • type hint for mypy

Copy link
Collaborator

@mr-tz mr-tz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thanks!

@yelhamer
Copy link
Collaborator

The failing tests are relevant to the the symbol extraction. The connect symbol (and others) aren't being extracted with this change, so we'd probably want to keep extracting the symbol's table using the sh_info field?

I'll take a further look at this in a while.

@williballenthin
Copy link
Collaborator Author

williballenthin commented Aug 14, 2023

ah, good call that the tests are failing 🤦🏼 good thing we have those!

tbh, i dont understand how the existing logic worked, except perhaps by random chance. i'll also dig into the failing tests and suggest further fixes.

@williballenthin
Copy link
Collaborator Author

williballenthin commented Aug 14, 2023

with 737fab7 tests are working for me again locally.

@williballenthin
Copy link
Collaborator Author

awaiting for tests to pass in CI and then i'll merge.

@williballenthin williballenthin merged commit 3169ee2 into master Aug 14, 2023
23 checks passed
@williballenthin williballenthin deleted the fix/issue-1704 branch August 14, 2023 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

elf: ValueError: symbol name not found
3 participants