[llvm] MC: Centralize X86 PC-relative fixup adjustment in MCAssembler (PR #147113)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 7 23:48:09 PDT 2025


================
@@ -587,22 +587,11 @@ void X86MCCodeEmitter::emitImmediate(const MCOperand &DispOp, SMLoc Loc,
     }
   }
 
-  // If the fixup is pc-relative, we need to bias the value to be relative to
-  // the start of the field, not the end of the field.
-  if (PCRel) {
-    ImmOffset -= Size;
-    // If this is a pc-relative load off _GLOBAL_OFFSET_TABLE_:
-    // leaq _GLOBAL_OFFSET_TABLE_(%rip), %r15
-    // this needs to be a GOTPC32 relocation.
-    if (Size == 4 && startsWithGlobalOffsetTable(Expr) != GOT_None)
-      FixupKind = X86::reloc_global_offset_table;
----------------
aengelke wrote:

Shouldn't removing this have an effect on test output?

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


More information about the llvm-commits mailing list