aarch64: Support GOT Relative relocations in PIC mode#5550
aarch64: Support GOT Relative relocations in PIC mode#5550jameysharp merged 4 commits intobytecodealliance:mainfrom
Conversation
|
Interesting. Looks like it runs and generates output of the sort I'd expect: But that particular relocation type isn't supported on arm64: Although, I did earlier discover that my Xcode suite is a version behind, so I'm going to save this comment for reference, and then see if this magically gets better after that. |
Sad to say: that wasn't it. Same error, after making sure everything was up-to-date. |
|
I think I got it, the Page Offset relocation was marked as being PC relative when writing the output file. And I think that was causing some confusion in the linker. Can you try with this latest commit? |
|
It works! Thank you! |
|
I worked through the audit backlog and pushed a commit to this branch with audit results. Someone else will need to review the PR since it has a commit from me now. |
a60faa6 to
29af10b
Compare
|
Thanks for looking into this! I had to rebase since we had a conflict in Cargo.lock but should be ready for review now. Edit: It looks like we have a similar situation to #5619 and its failing in CI due to duplicate deps. I can de-duplicate dependencies the same way I did in #5619 but I'm not sure I can de-duplicate Edit2: I can't de-duplicate |
|
If I'm reading the cargo-deny documentation correctly, it looks like we should be able to add something like this to [[bans.skip]]
name = "hashbrown"
version = "=0.12.3"Unlike |
29af10b to
0d12afc
Compare
|
Yeah, that seemed to have worked locally. I've applied the same updates that I did in the other PR (except object which is still at |
|
@cfallin would it be possible to vet the remaining dependencies? Once i updated our version of gimli it started saying that we need a safe to deploy validation, but weirdly it didn't before when it was just a transitive dependency of Edit: It looks like some of these might get vetted via #5513 |
|
@afonso360 would you be willing to rebase? I think this is good to go otherwise! |
0d12afc to
a30c7c8
Compare
a30c7c8 to
4ed3d99
Compare
|
Rebased on top of main, and removed the hashbrown exception. #5513 includes sort of the same exception, but ignores the tree of |
jameysharp
left a comment
There was a problem hiding this comment.
Looks good to me! Thanks for your patience as we figure out how best to use cargo-vet.
👋 Hey,
This PR adds support for using the GOT in PIC mode on AArch64. It implements the relocations for both ELF and MachO.
In order to support the MachO relocations we need to update the object crate. Unfortunately that also brings a few other dependencies which also need to be vetted.
@cfallin has already validated the object crate update up to
0.30.0in #5434 so we just need to do0.30.0 -> 0.30.1and the rest of the new dependencies.Tested this using the awesome example provided by @acw in zulip.
On aarch64-linux I was able to fully test this, on aarch64-darwin the decompiled file seems correct but I don't have a M1/2 machine to link and run it. Maybe @acw can test and report back if anything is wrong?
Fixes #2907
Fixes #5544