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

Parse object files with ElfFile64 rather than object::File #8593

Merged
merged 1 commit into from May 14, 2024

Conversation

alexcrichton
Copy link
Member

The latter is what Wasmtime uses today but it pulls in parsers for all object formats supported by object. In the context of Wasmtime, however, we know that all objects produced are 64-bit ELF files so there's no need to pull in, for example, a COFF parser as that'll always return an error anyway. This commit switches uses of the object::File convenience to ElfFile64 instead.

The latter is what Wasmtime uses today but it pulls in parsers for all
object formats supported by `object`. In the context of Wasmtime,
however, we know that all objects produced are 64-bit ELF files so
there's no need to pull in, for example, a COFF parser as that'll always
return an error anyway. This commit switches uses of the `object::File`
convenience to `ElfFile64` instead.
@alexcrichton alexcrichton requested a review from a team as a code owner May 10, 2024 15:34
@alexcrichton alexcrichton requested review from fitzgen and removed request for a team May 10, 2024 15:34
Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

I think we should be able to disable the default features of object and enable just the "elf" feature now.

@github-actions github-actions bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label May 10, 2024
@alexcrichton alexcrichton added this pull request to the merge queue May 14, 2024
@alexcrichton
Copy link
Member Author

Ah turns out we're already not-enabling coff/xe/etc, so not much else to do!

Merged via the queue into bytecodealliance:main with commit f334093 May 14, 2024
22 checks passed
@alexcrichton alexcrichton deleted the read-only-elf branch May 14, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasmtime:api Related to the API of the `wasmtime` crate itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants