This is an archive of the discontinued LLVM Phabricator instance.

Fix relocation problem when handling end section for Win x86
AbandonedPublic

Authored by wallace on May 10 2016, 11:15 AM.

Details

Reviewers
compnerd
abdulras
Summary

In the block in line 72, a dummy relocation entry is added for the end iterator. This is causing a problem because it has a relocation type that, for instance, if it is IMAGE_REL_I386_REL32, will try to be resolved later in the resolveRelocation function, which breaks some calculations because this dummy entry has invalid values, specifically the sectionA, which is -1.

Thus, I'm changing the relocation type to absolute, which in fact does no calculations.

However, I think that it might make sense not to include this dummy relocation entry. Removing it works with what i try to debug, but I don't know all the implications of this.

Diff Detail

Event Timeline

wallace updated this revision to Diff 56756.May 10 2016, 11:15 AM
wallace retitled this revision from to Fix relocation problem when handling end section for Win x86.
wallace updated this object.
wallace added reviewers: abdulras, compnerd.
wallace set the repository for this revision to rL LLVM.
compnerd requested changes to this revision.May 10 2016, 11:24 AM
compnerd edited edge metadata.

Please add a test case for this.

This revision now requires changes to proceed.May 10 2016, 11:24 AM
This comment was removed by wallace.
wallace updated this revision to Diff 56844.May 10 2016, 6:03 PM
wallace updated this object.
wallace edited edge metadata.
wallace removed rL LLVM as the repository for this revision.

I've changed the approach

compnerd requested changes to this revision.May 11 2016, 9:24 AM
compnerd edited edge metadata.

I think I prefer the original approach over this. This changes the internal representation of the relocation which makes it slightly harder to trace through. The original approach with a test case would be preferable. But, this still needs a test case.

This revision now requires changes to proceed.May 11 2016, 9:24 AM
sas added a subscriber: sas.May 12 2016, 6:41 PM

sadly i don't know which asm code can trigger this relocation type :(

wallace abandoned this revision.Nov 9 2017, 3:16 PM