Skip to content

s390x: Enable object backend#4680

Merged
cfallin merged 1 commit into
bytecodealliance:mainfrom
uweigand:s390x-reloc
Aug 10, 2022
Merged

s390x: Enable object backend#4680
cfallin merged 1 commit into
bytecodealliance:mainfrom
uweigand:s390x-reloc

Conversation

@uweigand
Copy link
Copy Markdown
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.

let opcode = 0xc05; // BRASL
let reloc = Reloc::S390xPCRel32Dbl;
let reloc = Reloc::S390xPLTRel32Dbl;
Copy link
Copy Markdown
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
Copy Markdown
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