[PATCH] D138135: [WIP][ELF] Support LoongArch

WÁNG Xuěruì via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 25 08:14:33 PST 2022


xen0n added inline comments.


================
Comment at: lld/ELF/InputSection.cpp:653
+    // duplicate some logic here.
+    if (sym.isTls()) {
+      if (sym.hasFlag(NEEDS_TLSGD))
----------------
MQ-mengqing wrote:
> xen0n wrote:
> > MQ-mengqing wrote:
> > > How about the "la.tls.ie" and "la.tls.gd" do the same symbol?
> > > How about the "la.tls.ie" and "la.tls.gd" do the same symbol?
> > 
> > What do you mean by "do the same symbol" here? Maybe you can tell me in a bit of Chinese if it's easier to explain that way... for now honestly I can't understand. (If you do attach some Chinese phrase I'll take care of translating it.)
> Sorry for the ambiguity words. I just care about the follows things,
> ```
> la.tls.ie $r4, y
> la.tls.gd $r5, y
> 
> .section .tbss
> .globl y
> y:
> .word   0
> .size   y, 4
> ```
> It plays differently with gnu as-ld.
I've located the TLS IE offset logic in the BFD code (IE symbol = offset by 2 GOT entries) and tried to do the same in LLD, but unfortunately the output was broken so I have to revert most of it. Sadly I won't have enough time to investigate before end of year.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138135/new/

https://reviews.llvm.org/D138135



More information about the llvm-commits mailing list