-
Notifications
You must be signed in to change notification settings - Fork 21
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
Cannot wrap IFUNC functions #76
Comments
I had some thoughts on fixing this. Right now we look up the wrappee by name via searching every DSO for an exported symbol. That works fine for normal GOT-based function symbols, as it follows the same search pattern that the linker uses. But it's fragile for any symbols that need special handling, such as IFUNCs or any future relocation types we need to handle. What if we instead just called the dynamic linker to do the binding? We would need to identify an existing call-site for that references that symbol (which we already do) and then call the dynamic linker resolve that callsite. We lift the linker's binding into our data structures, then overwrite the linker's decision with our wrappers. |
I'm not sure what the implementation for this looks like, but I think the idea sounds fine, and possibly more generally useful. If we get a solution for this, I'd love to see whether it resolves our Intel OpenMP bugs. |
A quick note that I ran into this problem with some of the functions
The problem here (besides not wrapping correctly) is that there is NO So, you could wrap |
FWIW, I've experienced some stranger behavior with the math functions too. I was wrapping I've found you need to pay attention to the actual symbols that are linked into the exe. I spent far too long thinking there was something else was going wrong bc how can you screw up getting the symbol name of a C function. It turned out that I had accidentally publicly exported a |
@mplegendre @jrmadsen Do we still need this feature? |
Gotcha is not correctly handling wrapping of functions with IFUNC relocations. We need a different procedure for calcluating the wrappee function of these.
The text was updated successfully, but these errors were encountered: