[llvm] [Mips] Fix clang integrated assembler generates incorrect relocations… (PR #83115)

YunQiang Su via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 16:53:20 PDT 2024


================
@@ -2920,11 +2922,45 @@ bool MipsAsmParser::loadAndAddSymbolAddress(const MCExpr *SymExpr,
         (Res.getSymA()->getSymbol().isELF() &&
          cast<MCSymbolELF>(Res.getSymA()->getSymbol()).getBinding() ==
              ELF::STB_LOCAL);
+
     // For O32, "$"-prefixed symbols are recognized as temporary while
     // .L-prefixed symbols are not (PrivateGlobalPrefix is "$"). Recognize ".L"
     // manually.
     if (ABI.IsO32() && Res.getSymA()->getSymbol().getName().starts_with(".L"))
       IsLocalSym = true;
+    else {
+      if (HasParseRdata == false) {
----------------
wzssyqa wrote:

It can be
```
else if (HasParseRdata == false)
```
So we won't need 2-level nest.

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


More information about the llvm-commits mailing list