-
Notifications
You must be signed in to change notification settings - Fork 514
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
Choose members of the dynamic tag enum based on the current machine #183
Conversation
elftools/elf/elffile.py
Outdated
@@ -71,7 +71,7 @@ def __init__(self, stream): | |||
|
|||
self.structs.create_basic_structs() | |||
self.header = self._parse_elf_header() | |||
self.structs.create_advanced_structs(self['e_type'], self['e_machine']) | |||
self.structs.create_advanced_structs(self['e_type'], self['e_machine'], self['e_ident']['EI_OSABI']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please wrap this for 80-col lines
elftools/elf/enums.py
Outdated
EM_MIPS=ENUM_D_TAG_MIPS, | ||
EM_MIPS_RS3_LE=ENUM_D_TAG_MIPS, | ||
# TODO: add the rest | ||
# solaris doesn't go here because what matters is e_ident[EI_OSABI] == ELFOSABI_SOLARIS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow this comment. What are you trying to say? It may be obvious that we now have a separate section for the solaris tags, so maybe it's superfluous?
'exe_solaris32_cc.sparc.elf')) | ||
f2 = extract_sunw(os.path.join('test', 'testfiles_for_unittests', | ||
'android_dyntags.elf')) | ||
self.assertEqual(f1, {'DT_SUNW_STRPAD', 'DT_SUNW_LDMACH'}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice testing!
Do you think it would be possible to add readelf-comparison tests for these files?
Thanks for the contribution, this looks great overall. I left some (minor) comments in the review. |
Fix pushed. I tried running readelf.py on the test files and I actually found a bug with the PR, so that's been resolved (along with the other changes). However, when I tried adding a readelf-comparison test, it failed extremely badly for a lot of reasons unrelated to this PR, notably the naming of solaris-specific sections and |
…liben#183) * Only use processor/os specific dynamic tags if that processor or os is in use * Add testcase for machine-specific dynamic tags * Clarify layout of ENUM_D_TAG
closes #175
Adds a testcase and a 35k android marshmallow library (libsoundtrigger.so) for the testcase. The testcase also reuses an existing solaris test binary.