[PATCH] D63220: [ELF][RISCV] Support GD/LD/IE/LE TLS models
James Clarke via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 13 01:55:44 PDT 2019
jrtc27 requested changes to this revision.
jrtc27 added inline comments.
This revision now requires changes to proceed.
================
Comment at: ELF/Arch/RISCV.cpp:77
RelativeRel = R_RISCV_RELATIVE;
SymbolicRel = Config->Is64 ? R_RISCV_64 : R_RISCV_32;
+ if (Config->Is64) {
----------------
I think it would be better to fold this into the if.
================
Comment at: ELF/Relocations.cpp:224
+ // If the TLS model can be relaxed to Local-Exec, DTPMOD is constant one.
+ bool IsLocalExec = !Config->Shared && !Sym.IsPreemptible;
+
----------------
The RISC-V behaviour is identical to ARM if I remember correctly, so we should be reusing that code rather than reimplementing it again here.
================
Comment at: test/ELF/riscv-tls-ld.s:1
+# REQUIRES: riscv
+# RUN: echo '.tbss; .globl b, c; b: .zero 4; c:' > %t.s
----------------
This file is the same as GD just with different check prefixes, no? RISC-V’s local dynamic is the same as global dynamic as far as relocations are concerned.
Repository:
rLLD LLVM Linker
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63220/new/
https://reviews.llvm.org/D63220
More information about the llvm-commits
mailing list