[llvm] f1aee59 - ARM: Remove unneeded ARM::fixup_arm_thumb_bl special case

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 22 01:08:38 PDT 2025


Author: Fangrui Song
Date: 2025-08-22T01:08:33-07:00
New Revision: f1aee598e74ea6ce72118d775862c0243bca980d

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

LOG: ARM: Remove unneeded ARM::fixup_arm_thumb_bl special case

This is a weird special case added in 2015, simplifying an even older
condition. It is a no-op for ELF (isExternal is always false) and seems
unneeded for non-ELF.

Added: 
    

Modified: 
    llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
index 5d5a49aff0615..01fe13b343926 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
@@ -937,17 +937,6 @@ bool ARMAsmBackend::shouldForceRelocation(const MCFixup &Fixup,
                                           const MCValue &Target) {
   const MCSymbol *Sym = Target.getAddSym();
   const unsigned FixupKind = Fixup.getKind();
-  if (FixupKind == ARM::fixup_arm_thumb_bl) {
-    assert(Sym && "How did we resolve this?");
-
-    // If the symbol is external the linker will handle it.
-    // FIXME: Should we handle it as an optimization?
-
-    // If the symbol is out of range, produce a relocation and hope the
-    // linker can handle it. GNU AS produces an error in this case.
-    if (Sym->isExternal())
-      return true;
-  }
   // Create relocations for unconditional branches to function symbols with
   // 
diff erent execution mode in ELF binaries.
   if (needsInterworking(*Asm, Sym, Fixup.getKind()))


        


More information about the llvm-commits mailing list