MC: "error: A dwo section may not contain relocations" when building with fission + RISCV64 · Issue #56642 · llvm/llvm-project (original) (raw)

When building with fission, the DW_AT_high_pc field in .debug_info which is redirected to .debug_info.dwo will contain a label difference. The field is meant to be DW_AT_low_pc relative distance, so the difference is unavoidable. Furthermore, with relaxation, the size of the function may change at link time, and thus needs to be resolved at link time.

It appears that gcc will emit the object file, duplicate it and then "extract the DWO sections" dropping the associated relocations resulting in the file showing no relocations.

// RUN: %clang_cc1 -triple riscv64-unknown-linux-gnu -debug-info-kind=constructor -emit-obj -o %t.o -split-dwarf-file %t.dwo -split-dwarf-output %t.dwo int f(void) { return 32; }