Skip to content
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

s390x: Enable object backend #4680

Merged
merged 1 commit into from
Aug 10, 2022
Merged

Conversation

uweigand
Copy link
Member

This enables the object backend for s390x, in particular the
processing of all required relocations.

This uncovered a bug: we need to use PLT relocations for the
target of calls, which we currently do not. Fixed by adding
a new S390xPLTRel32Dbl reloc type and using it where needed.

FYI - @cfallin @bjorn3

This enables the object backend for s390x, in particular the
processing of all required relocations.

This uncovered a bug: we need to use PLT relocations for the
target of calls, which we currently do not.  Fixed by adding
a new S390xPLTRel32Dbl reloc type and using it where needed.
@@ -3216,7 +3216,7 @@ impl MachInstEmit for Inst {
}

let opcode = 0xc05; // BRASL
let reloc = Reloc::S390xPCRel32Dbl;
let reloc = Reloc::S390xPLTRel32Dbl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should check is_colocated and use PCRel if true. That is faster than going through the PLT.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not really necessary; the JIT backend doesn't use PLTs anyway, and when generating object files, the linker will omit PLTs when they are not needed. LLVM also always emits PLT relocations and relies on the linker to optimize them away.

@cfallin cfallin enabled auto-merge (squash) August 10, 2022 19:09
@cfallin cfallin merged commit be36dd6 into bytecodealliance:main Aug 10, 2022
@uweigand uweigand deleted the s390x-reloc branch August 10, 2022 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants