draperlaboratory / VIBES

Verified, Incremental, Binary Editing with Synthesis
MIT License
51 stars 1 forks source link

Attempt branch relaxation during patch situation #245

Closed bmourad01 closed 1 year ago

bmourad01 commented 1 year ago

Sometimes, we will end up with the (compiled) patch assembly that contains conditional branches to targets that are out of range (and we get an error from the system assembler indicating this). Our previous solution consisted of a pass in vibes-opt to correct this, but it is premature, sometimes leading to false positives as well as false negatives.

The truth is that we cannot perform this step until we try to situate the patch somewhere in the binary, and indeed a production-grade compiler would perform this step very late in the pipeline. So, this PR attempts to do the same.