-
Notifications
You must be signed in to change notification settings - Fork 156
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
Reverse the order of emitting relocations on MachO #702
Conversation
This prevents a crash of Apple's new linker.
This probably should be treated as a breaking change. What do you think about trying to avoid that by detecting if it needs to be reversed? Too magical? let need_reverse = |relocs: &[Relocation]| {
let Some(first) = relocs.first() else { return false; };
let Some(last) = relocs.last() else { return false; };
first.offset < last.offset
};
if need_reverse(§ion.relocations) {
for reloc in section.relocations.iter().rev() {
write_reloc(reloc)?;
}
} else {
for reloc in §ion.relocations {
write_reloc(reloc)?;
}
} Also, out of interest, I checked that just swapping the |
Maybe? I applied your suggestion anyway. |
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.
Thanks!
Would it be possible to get a patch release for this? That would allow me to fix cg_clif on arm64 macOS quicker as I wouldn't need to get a Cranelift PR for bumping the object version merged and wait a couple of weeks for the next Cranelift release. |
Yes, I'll do a release tomorrow. |
Released 0.36.1 |
This prevents a crash of Apple's new linker.