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

pe: Improve PE Loader Relocation #85

Merged
merged 3 commits into from
Feb 19, 2021

Conversation

retrage
Copy link
Contributor

@retrage retrage commented Jan 16, 2021

This PR improves PE relocation support.

4c2696a and 10ef5a7 are small fixes based on the PE/COFF format specification. 4c2696a fixes the panic reported in issue #73.

794caf6 changes the loader behavior to load to the preferred address if the ImageBase in the PE header is a non-zero value.
If it is not specified, it loads at the binary at the default address 0x20_0000.

This commit fixes loading error reported in issue #73.

Signed-off-by: Akira Moroo <retrage01@gmail.com>
Signed-off-by: Akira Moroo <retrage01@gmail.com>
According to PE/COFF format spec., base relocation BlockSize includes
PageRVA and BlockSize fields. This commit fixes to set the followed
Type/Offset block offset correctly.

Signed-off-by: Akira Moroo <retrage01@gmail.com>
@rbradford
Copy link
Member

@retrage I've triggered a rebuild in case the CI failure was a flake.

@retrage
Copy link
Contributor Author

retrage commented Feb 11, 2021

@josephlr ping

@rbradford rbradford merged commit dd5d187 into cloud-hypervisor:master Feb 19, 2021
@retrage retrage deleted the pe-loader-fixes branch March 13, 2021 05:00
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.

2 participants