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

[BOLT][RISCV] Implement TLS le/ie relocations #67112

Merged
merged 1 commit into from
Oct 5, 2023
Merged

Conversation

mtvec
Copy link
Contributor

@mtvec mtvec commented Sep 22, 2023

Handle the following relocations related to TLS local-exec and initial-exec:

  • R_RISCV_TLS_GOT_HI20
  • R_RISCV_TPREL_HI20
  • R_RISCV_TPREL_ADD
  • R_RISCV_TPREL_LO12_I
  • R_RISCV_TPREL_LO12_S

In addition, GNU ld has a quirk where after TLS le relaxation, two unofficial relocation types may be emitted:

  • R_RISCV_TPREL_I
  • R_RISCV_TPREL_S

Since they are unofficial (defined in the reserved range of relocation types), LLVM does not define them. Hence, I've defined them locally in BOLT in a private namespace.

@mtvec
Copy link
Contributor Author

mtvec commented Oct 4, 2023

Ping.

Handle the following relocations related to TLS local-exec and
initial-exec:
- R_RISCV_TLS_GOT_HI20
- R_RISCV_TPREL_HI20
- R_RISCV_TPREL_ADD
- R_RISCV_TPREL_LO12_I
- R_RISCV_TPREL_LO12_S

In addition, GNU ld has a quirk where after TLS le relaxation, two
unofficial relocation types may be emitted:
- R_RISCV_TPREL_I
- R_RISCV_TPREL_S

Since they are unofficial (defined in the reserved range of relocation
types), LLVM does not define them. Hence, I've defined them locally in
BOLT in a private namespace.
Copy link
Contributor

@rafaelauler rafaelauler left a comment

Choose a reason for hiding this comment

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

Thanks!

@mtvec mtvec merged commit c7d6d62 into llvm:main Oct 5, 2023
@mtvec mtvec deleted the bolt-riscv-tls branch October 10, 2023 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants