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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 23 23:34:36 PST 2022


MaskRay added a comment.

Not sure why so many Loongson people from the same company who don't usually contribute to lld were added to the reviewer list... Just changed myself to a blocking reviewer.



================
Comment at: lld/ELF/Arch/LoongArch.cpp:240
+  if (config->is64)
+    write64le(buf, in.plt->getVA());
+  else
----------------
This is likely something like `s.getPltVA()`


================
Comment at: lld/ELF/Arch/LoongArch.cpp:349
+  case R_LARCH_TLS_IE64_PC_HI12:
+    config->hasTlsIe = true;
+    return R_LOONGARCH_GOT_PAGE_PC;
----------------
I moved hasTlsIe to `ctx` in 2022-10.


================
Comment at: lld/ELF/InputSection.cpp:647
+    // XXX Why???
+    if (config->emachine == EM_LOONGARCH && sym.isTls()) {
+      if (sym.hasFlag(NEEDS_TLSLD))
----------------
... and relocation behaviors should not be changed by the bogus NEEDS_TLSLD flag.


================
Comment at: lld/ELF/Symbols.h:57
   NEEDS_TLSIE = 1 << 8,
+  NEEDS_TLSLD = 1 << 9,
 };
----------------
This is wrong. Using TLS LD is a global decision, not per symbol.


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