Debug builds put their thunk functions right at the start of .text. To match these up, we just scan the list in orig and recomp and look for cases where each points to the same real function that has already been matched.
I had assumed each thunk would only appear once, but there are duplicates in BETA10. (I would guess that only one ends up being used in most/all cases.)
This changes match_thunks() so that we detect any duplicates and match in order of the thunk's virtual address. This is probably a naive way to do it, but it works fine for the code in its current state. (Open question: does thunk order depend on module order?)
Debug builds put their thunk functions right at the start of
.text
. To match these up, we just scan the list in orig and recomp and look for cases where each points to the same real function that has already been matched.I had assumed each thunk would only appear once, but there are duplicates in BETA10. (I would guess that only one ends up being used in most/all cases.)
This changes
match_thunks()
so that we detect any duplicates and match in order of the thunk's virtual address. This is probably a naive way to do it, but it works fine for the code in its current state. (Open question: does thunk order depend on module order?)