Skip to content
This repository was archived by the owner on Aug 17, 2022. It is now read-only.

Commit 2dfac04

Browse files
committed
Disable relaxation in the presence of .cfi directives
The GAS internals perform intra-section label subtractions, which conflict with our linker relaxations. So don't relax when emitting them. GCC can emit DWARF directly, so this doesn't actually prevent relaxation in the common case.
1 parent c32df47 commit 2dfac04

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gas/config/tc-riscv.c

+4
Original file line numberDiff line numberDiff line change
@@ -2408,6 +2408,10 @@ RISC-V options:\n\
24082408
void
24092409
riscv_cfi_frame_initial_instructions (void)
24102410
{
2411+
/* The generic DWARF code assumes that intra-section labels can be
2412+
subtracted at assembly time, which precludes relaxation. */
2413+
riscv_opts.relax = 0;
2414+
24112415
cfi_add_CFA_def_cfa_register (X_SP);
24122416
}
24132417

0 commit comments

Comments
 (0)