-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
AArch64: Fix passing function pointers #5896
Conversation
@@ -920,6 +920,8 @@ fn build_proc<'a, B: Backend<'a>>( | |||
} | |||
} | |||
Relocation::LinkedData { offset, name } => { | |||
add_undefined_rc_proc(output, name, &rc_proc_names); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't it weird that an RC proc ends up here? I'm happy it works but would like to understand why a bit beter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@folkertdev Yeah, it took me a while to figure out what was going on here, but I think it's expected.
Mono IR does not include these specific helper/wrappers as Proc
s, but they are instead generated by the dev backend when it encounters CallType::HigherOrder
here.
Since we don't pass a mutable Object
reference to backend.build_proc
, it can't add any extra Proc
s itself, but it instead returns them so we can add them in object_builder
as it already did for LinkedFunction
.
I agree it's a little subtle, but I didn't want to make too invasive of a change. Let me know if you think we should, though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the missing piece for me was that we use the data_pointer function to create function pointers in this case. Then things make more sense. I think this is fine then
Thank you, commits included in #5839 |
In the ARM dev backend, we use
LinkedData
for function pointers, butobject_builder
only added undefined RC procs forLinkedFunction
relocs, leading to a crash later when looking up its symbol.This fixes 52 tests 🎉