Skip to content

Commit e5bcdbf

Browse files
committed
Disable this performance opt on RISCV
See the comments on bbea642, the RISCV relocation model does something differently, and thus we need to emit linetables in a fully symbolic way.
1 parent ccf5125 commit e5bcdbf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/MC/MCObjectStreamer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,10 @@ void MCObjectStreamer::emitDwarfAdvanceLineAddr(int64_t LineDelta,
467467
// fragment, then the address-offset is already a fixed constant and is not
468468
// relaxable. Emit the advance-line-addr data immediately to save time and
469469
// memory.
470+
// As per commit bbea64250f6548, RISCV always desires symbolic relocations.
470471
MCFragment *LastFrag = LastLabel->getFragment();
471-
if (LastFrag->getKind() == MCFragment::FT_Data &&
472+
if (!getAssembler().getContext().getTargetTriple().isRISCV() &&
473+
LastFrag->getKind() == MCFragment::FT_Data &&
472474
Label->getFragment() == LastFrag) {
473475
uint64_t AddrDelta = Label->getOffset() - LastLabel->getOffset();
474476
SmallString<16> Tmp;

0 commit comments

Comments
 (0)