uweigand opened PR #4616 from s390x-tls-value
to main
:
Implement the tls_value for s390 in the ELF general-dynamic mode.
Notable differences to the x86_64 implementation are:
- We use a __tls_get_offset libcall instead of __tls_get_addr.
The current thread pointer (stored in a pair of access registers)
needs to be added to the result of __tls_get_offset.__tls_get_offset has a variant ABI that requires the address of
the GOT (global offset table) is passed in %r12.This means we need new libcall entries for __tls_get_offset and
the _GLOBAL_OFFSET_TABLE_ symbol. The latter is a bit weird in
that it is not actually a function, so "libcall" seems a bit
inappropiate. But there currently is no way, apart from the
libcall mechanism, so refer to a well-known global symbol by name.We also need to emit a relocation on a symbol placed in a
constant pool, as well as an extra relocation on the call
to __tls_get_offset required for TLS linker optimization.Needed by the cg_clif frontend.
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
uweigand updated PR #4616 from s390x-tls-value
to main
.
uweigand updated PR #4616 from s390x-tls-value
to main
.
uweigand updated PR #4616 from s390x-tls-value
to main
.
uweigand edited PR #4616 from s390x-tls-value
to main
:
Implement the tls_value for s390 in the ELF general-dynamic mode.
Notable differences to the x86_64 implementation are:
- We use a
__tls_get_offset
libcall instead of__tls_get_addr
.The current thread pointer (stored in a pair of access registers)
needs to be added to the result of__tls_get_offset
.
__tls_get_offset
has a variant ABI that requires the address of
the GOT (global offset table) is passed in %r12.This means we need a new libcall entries for
__tls_get_offset
.
In addition, we also need a way to access_GLOBAL_OFFSET_TABLE_
.
The latter is a "magic" symbol with a well-known name defined
by the ABI and recognized by the linker. This patch introduces
a newExternalName::KnownSymbol
variant to support such names
(originally due to @afonso360).We also need to emit a relocation on a symbol placed in a
constant pool, as well as an extra relocation on the call
to__tls_get_offset
required for TLS linker optimization.Needed by the cg_clif frontend.
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
cfallin submitted PR review.
cfallin merged PR #4616.
Last updated: Dec 23 2024 at 12:05 UTC