[llvm] [PowerPC] Support local-dynamic TLS relocation on AIX (PR #66316)

Ting Wang via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 00:37:10 PDT 2023


================
@@ -846,6 +870,15 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) {
       return MCSymbolRefExpr::VariantKind::VK_PPC_AIX_TLSGDM;
     if (MO.getTargetFlags() & PPCII::MO_TLSGD_FLAG)
       return MCSymbolRefExpr::VariantKind::VK_PPC_AIX_TLSGD;
+    if (MO.getTargetFlags() & PPCII::MO_TLSLD_FLAG) {
+      if (isSpecialAIXSymbolTLSML(MO, IsAIX))
+        // FIXME: On AIX the ML relocation type is only valid for a reference to
+        // a TOC symbol from the symbol itself, and right now its only user is
+        // symbol "_$TLSML". Use symbol name to decide that R_TLSML is expected.
+        return MCSymbolRefExpr::VariantKind::VK_PPC_AIX_TLSML;
+      if (IsAIX)
----------------
orcguru wrote:

I have to hitchhike the `VK_PPC_AIX_TLSML` under `PPCII::MO_TLSLD_FLAG` as  PPCII TOF is already full, and due to the relevance with TLSLD, I prefer to add the check here.

https://github.com/llvm/llvm-project/pull/66316


More information about the llvm-commits mailing list