[llvm] 8ee6c0e - [MC] Remove isThumbFunc special case

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 13:15:01 PDT 2023


Author: Fangrui Song
Date: 2023-08-10T13:14:56-07:00
New Revision: 8ee6c0ea0bf30f1f1da6b49ee720b933f9676a30

URL: https://github.com/llvm/llvm-project/commit/8ee6c0ea0bf30f1f1da6b49ee720b933f9676a30
DIFF: https://github.com/llvm/llvm-project/commit/8ee6c0ea0bf30f1f1da6b49ee720b933f9676a30.diff

LOG: [MC] Remove isThumbFunc special case

The special case from 9746286beca2539438e0a6b783e106bc359036ca (2011)
seems irrelevant nowadays. It is actually incorrect because GNU
assembler does not set the least significant bit for `.long thumb - .`.

Added: 
    

Modified: 
    llvm/lib/MC/MCExpr.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/MC/MCExpr.cpp b/llvm/lib/MC/MCExpr.cpp
index a7b980553af055..9d08fba378fb0e 100644
--- a/llvm/lib/MC/MCExpr.cpp
+++ b/llvm/lib/MC/MCExpr.cpp
@@ -606,11 +606,6 @@ static void AttemptToFoldSymbolOffsetDifference(
     return;
 
   auto FinalizeFolding = [&]() {
-    // Pointers to Thumb symbols need to have their low-bit set to allow
-    // for interworking.
-    if (Asm->isThumbFunc(&SA))
-      Addend |= 1;
-
     // If symbol is labeled as micromips, we set low-bit to ensure
     // correct offset in .gcc_except_table
     if (Asm->getBackend().isMicroMips(&SA))


        


More information about the llvm-commits mailing list