diff --git a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchELFObjectWriter.cpp b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchELFObjectWriter.cpp --- a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchELFObjectWriter.cpp +++ b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchELFObjectWriter.cpp @@ -24,13 +24,6 @@ ~LoongArchELFObjectWriter() override; - // Return true if the given relocation must be with a symbol rather than - // section plus offset. - bool needsRelocateWithSymbol(const MCSymbol &Sym, - unsigned Type) const override { - return true; - } - protected: unsigned getRelocType(MCContext &Ctx, const MCValue &Target, const MCFixup &Fixup, bool IsPCRel) const override; diff --git a/llvm/test/MC/LoongArch/Relocations/fde-reloc.s b/llvm/test/MC/LoongArch/Relocations/fde-reloc.s --- a/llvm/test/MC/LoongArch/Relocations/fde-reloc.s +++ b/llvm/test/MC/LoongArch/Relocations/fde-reloc.s @@ -10,5 +10,5 @@ .cfi_endproc # CHECK: Section (4) .rela.eh_frame { -# CHECK-NEXT: 0x1C R_LARCH_32_PCREL - 0x0 +# CHECK-NEXT: 0x1C R_LARCH_32_PCREL .text 0x0 # CHECK-NEXT: }