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

fixed TLS issues and pass unit tests #26

Merged
merged 1 commit into from
Jun 1, 2022
Merged

fixed TLS issues and pass unit tests #26

merged 1 commit into from
Jun 1, 2022

Conversation

unicornx
Copy link

RISC-V ELF Specification defines each pointer in DTV
points to 0x800(TLS_DTV_OFFSET) past the start of a TLS block, which has
been suppored well for IE model but not for GD model. This change
complete TLS for GD model.

Note, in our new design, to not modify original code too much, the
pointer in DTV still point to the start of a TLS block, we just compensate
TLS_DTV_OFFSET at two places, one is in relocation(TLS_DTPREL), another
is the place where the pointer of TLS block is returned.

For x86/arm, we can think TLS_DTV_OFFSET was defined as zero to
compatible with current code-base.

Along with this change, we passed following unit cases:

  • elftls_dl.access_static_tls
  • elftls_dl.dtv_resize
  • elftls_dl.dlsym_static_tls
  • elftls_dl.dlsym_dynamic_tls

Signed-off-by: Chen Wang wangchen20@iscas.ac.cn

RISC-V ELF Specification defines each pointer in DTV
points to 0x800(TLS_DTV_OFFSET) past the start of a TLS block, which has
been suppored well for IE model but not for GD model. This change
complete TLS for GD model.

Note, in our new design, to not modify original code too much, the
pointer in DTV still point to the start of a TLS block, we just compensate
TLS_DTV_OFFSET at two places, one is in relocation(TLS_DTPREL), another
is the place where the pointer of TLS block is returned.

For x86/arm, we can think TLS_DTV_OFFSET was defined as zero to
compatible with current code-base.

Along with this change, we passed following unit cases:
- elftls_dl.access_static_tls
- elftls_dl.dtv_resize
- elftls_dl.dlsym_static_tls
- elftls_dl.dlsym_dynamic_tls

Signed-off-by: Chen Wang <wangchen20@iscas.ac.cn>
@MaoHan001 MaoHan001 merged commit 38e887a into riscv-android-src:riscv64-android-12.0.0_dev Jun 1, 2022
@unicornx unicornx deleted the plct-dev-tls-passtest branch June 1, 2022 03:22
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.

None yet

2 participants