MaskRay wrote:

I have found several issues.

* `tlsDescRel = R_RISCV_TLSDESC_CALL;` should be `R_RISCV_TLSDESC`
* LOAD_LO12_I/ADD_LO12_I/CALL relocations reference a label at the HI20 
location. `val` computed by `sec.getRelocTargetVA` cannot be used as-is.
* TLS optimization 
(https://maskray.me/blog/2021-02-14-all-about-thread-local-storage#link-time-tls-optimization)
 is actually mandatory for TLSDESC. Unlike ia32, we don't need `adjustTlsExpr`. 
Some special handling is required.

#79099 reuses an old revision of the LLVM part but otherwise is a rewrite and 
should fix these issues as well as implement linker relaxation.

https://github.com/llvm/llvm-project/pull/77516
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to